Skip to content

Commit 21a0d6c

Browse files
committed
Revert "use Stderr"
This reverts commit ee8fe46.
1 parent ee8fe46 commit 21a0d6c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmd/dbc/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ func failSubcommandAndSuggest(p *arg.Parser, msg string, subcommand ...string) {
190190
}
191191
}
192192

193-
p.WriteUsageForSubcommand(os.Stderr, subcommand...)
194-
fmt.Fprintf(os.Stderr, "error: %s", msg)
193+
p.WriteUsageForSubcommand(os.Stdout, subcommand...)
194+
fmt.Fprintf(os.Stdout, "error: %s", msg)
195195

196196
// Optionally add suggestion
197197
if invalidCmd != "" {
@@ -231,18 +231,18 @@ func main() {
231231
}
232232

233233
if p.Subcommand() == nil {
234-
p.WriteHelp(os.Stderr)
234+
p.WriteHelp(os.Stdout)
235235
os.Exit(1)
236236
}
237237

238238
var m tea.Model
239239

240240
switch sub := p.Subcommand().(type) {
241241
case *AuthCmd:
242-
p.WriteHelpForSubcommand(os.Stderr, p.SubcommandNames()...)
242+
p.WriteHelpForSubcommand(os.Stdout, p.SubcommandNames()...)
243243
os.Exit(2)
244244
case *completions.Cmd: // "dbc completions" without specifying the shell type
245-
p.WriteHelpForSubcommand(os.Stderr, p.SubcommandNames()...)
245+
p.WriteHelpForSubcommand(os.Stdout, p.SubcommandNames()...)
246246
os.Exit(2)
247247
case completions.ShellImpl:
248248
fmt.Print(sub.GetScript())

0 commit comments

Comments
 (0)