From 6ab9794b04a6fff6282f5cd0218a0a6def51be95 Mon Sep 17 00:00:00 2001 From: Neil Macneale IV Date: Mon, 15 May 2023 16:52:04 -0700 Subject: [PATCH 1/2] Print global arguments for 'dolt --help' but not 'dolt' --- go/cmd/dolt/dolt.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/go/cmd/dolt/dolt.go b/go/cmd/dolt/dolt.go index 2b97e77572..9b6675c20b 100644 --- a/go/cmd/dolt/dolt.go +++ b/go/cmd/dolt/dolt.go @@ -427,6 +427,12 @@ func runMain() int { globalArgs, args, initCliContext, printUsage, err := splitArgsOnSubCommand(args) if printUsage { doltCommand.PrintUsage("dolt") + _, usage := cli.HelpAndUsagePrinters(cli.CommandDocsForCommandString("dolt", doc, globalArgParser)) + + cli.Println("\n\nDolt subcommands are in transition to using the flags listed below as global flags. ") + cli.Println("The sql subcommand is currently the only command that uses these flags. All other commands will ignore them.\n") + usage() + return 0 } if err != nil { From 9944a32b733b6ef046d0360ba109ad409c6f67ae Mon Sep 17 00:00:00 2001 From: Neil Macneale IV Date: Mon, 15 May 2023 17:26:17 -0700 Subject: [PATCH 2/2] Now with no \n chars --- go/cmd/dolt/dolt.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/go/cmd/dolt/dolt.go b/go/cmd/dolt/dolt.go index 9b6675c20b..ca83ffd20a 100644 --- a/go/cmd/dolt/dolt.go +++ b/go/cmd/dolt/dolt.go @@ -429,8 +429,11 @@ func runMain() int { doltCommand.PrintUsage("dolt") _, usage := cli.HelpAndUsagePrinters(cli.CommandDocsForCommandString("dolt", doc, globalArgParser)) - cli.Println("\n\nDolt subcommands are in transition to using the flags listed below as global flags. ") - cli.Println("The sql subcommand is currently the only command that uses these flags. All other commands will ignore them.\n") + specialMsg := ` +Dolt subcommands are in transition to using the flags listed below as global flags. +The sql subcommand is currently the only command that uses these flags. All other commands will ignore them. +` + cli.Println(specialMsg) usage() return 0