Merge pull request #517 from akshaychhajed/help-output-stdout

Thank you!
This commit is contained in:
Shlomi Noach 2017-11-01 09:34:30 +02:00 committed by GitHub
commit 82b7f2a564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,6 +121,7 @@ func main() {
version := flag.Bool("version", false, "Print version & exit") version := flag.Bool("version", false, "Print version & exit")
checkFlag := flag.Bool("check-flag", false, "Check if another flag exists/supported. This allows for cross-version scripting. Exits with 0 when all additional provided flags exist, nonzero otherwise. You must provide (dummy) values for flags that require a value. Example: gh-ost --check-flag --cut-over-lock-timeout-seconds --nice-ratio 0") checkFlag := flag.Bool("check-flag", false, "Check if another flag exists/supported. This allows for cross-version scripting. Exits with 0 when all additional provided flags exist, nonzero otherwise. You must provide (dummy) values for flags that require a value. Example: gh-ost --check-flag --cut-over-lock-timeout-seconds --nice-ratio 0")
flag.StringVar(&migrationContext.ForceTmpTableName, "force-table-names", "", "table name prefix to be used on the temporary tables") flag.StringVar(&migrationContext.ForceTmpTableName, "force-table-names", "", "table name prefix to be used on the temporary tables")
flag.CommandLine.SetOutput(os.Stdout)
flag.Parse() flag.Parse()
@ -128,7 +129,7 @@ func main() {
return return
} }
if *help { if *help {
fmt.Fprintf(os.Stderr, "Usage of gh-ost:\n") fmt.Fprintf(os.Stdout, "Usage of gh-ost:\n")
flag.PrintDefaults() flag.PrintDefaults()
return return
} }