From a73e09c89be0c7dab7a7187b358374608c2aa888 Mon Sep 17 00:00:00 2001 From: coffeegoddd Date: Tue, 7 Jan 2025 09:44:14 -0800 Subject: [PATCH] /go/cmd/dolt/commands/ci: unhide commands, fix help text --- go/cmd/dolt/commands/ci/ci.go | 2 +- go/cmd/dolt/commands/ci/destroy.go | 11 ++++++----- go/cmd/dolt/commands/ci/export.go | 6 +++--- go/cmd/dolt/commands/ci/import.go | 4 ++-- go/cmd/dolt/commands/ci/init.go | 11 +++++------ go/cmd/dolt/commands/ci/ls.go | 11 ++++++----- go/cmd/dolt/commands/ci/remove.go | 6 +++--- 7 files changed, 26 insertions(+), 25 deletions(-) diff --git a/go/cmd/dolt/commands/ci/ci.go b/go/cmd/dolt/commands/ci/ci.go index 2877104863..7fb11e0b5b 100644 --- a/go/cmd/dolt/commands/ci/ci.go +++ b/go/cmd/dolt/commands/ci/ci.go @@ -18,7 +18,7 @@ import ( "github.com/dolthub/dolt/go/cmd/dolt/cli" ) -var Commands = cli.NewHiddenSubCommandHandler("ci", "Commands for working with Dolt continuous integration configuration.", []cli.Command{ +var Commands = cli.NewSubCommandHandler("ci", "Commands for working with Dolt continuous integration configuration.", []cli.Command{ InitCmd{}, DestroyCmd{}, ImportCmd{}, diff --git a/go/cmd/dolt/commands/ci/destroy.go b/go/cmd/dolt/commands/ci/destroy.go index c4974e891b..039de33760 100644 --- a/go/cmd/dolt/commands/ci/destroy.go +++ b/go/cmd/dolt/commands/ci/destroy.go @@ -27,10 +27,10 @@ import ( ) var destroyDocs = cli.CommandDocumentationContent{ - ShortDesc: "Drops database tables used to store continuous integration configuration", - LongDesc: "Drops database tables used to store continuous integration configuration", + ShortDesc: "Drops all database tables used to store continuous integration configuration", + LongDesc: "Drops all database tables used to store continuous integration configuration and creates a Dolt commit", Synopsis: []string{ - "{{.LessThan}}destroy{{.GreaterThan}}", + "", }, } @@ -59,7 +59,7 @@ func (cmd DestroyCmd) Docs() *cli.CommandDocumentation { // Hidden should return true if this command should be hidden from the help text func (cmd DestroyCmd) Hidden() bool { - return true + return false } // ArgParser implements cli.Command. @@ -71,7 +71,8 @@ func (cmd DestroyCmd) ArgParser() *argparser.ArgParser { // Exec implements cli.Command. func (cmd DestroyCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv, cliCtx cli.CliContext) int { ap := cmd.ArgParser() - _, usage := cli.HelpAndUsagePrinters(cli.CommandDocsForCommandString(commandStr, initDocs, ap)) + help, usage := cli.HelpAndUsagePrinters(cli.CommandDocsForCommandString(commandStr, destroyDocs, ap)) + cli.ParseArgsOrDie(ap, args, help) if !cli.CheckEnvIsValid(dEnv) { return 1 diff --git a/go/cmd/dolt/commands/ci/export.go b/go/cmd/dolt/commands/ci/export.go index a9235126ff..2ffd71f65e 100644 --- a/go/cmd/dolt/commands/ci/export.go +++ b/go/cmd/dolt/commands/ci/export.go @@ -33,8 +33,8 @@ import ( ) var exportDocs = cli.CommandDocumentationContent{ - ShortDesc: "Export a Dolt continuous integration workflow file by name", - LongDesc: "Export a Dolt continuous integration workflow file by name", + ShortDesc: "Export a Dolt continuous integration workflow by name", + LongDesc: "Export a Dolt continuous integration workflow by name", Synopsis: []string{ "{{.LessThan}}workflow name{{.GreaterThan}}", }, @@ -65,7 +65,7 @@ func (cmd ExportCmd) Docs() *cli.CommandDocumentation { // Hidden should return true if this command should be hidden from the help text func (cmd ExportCmd) Hidden() bool { - return true + return false } // ArgParser implements cli.Command. diff --git a/go/cmd/dolt/commands/ci/import.go b/go/cmd/dolt/commands/ci/import.go index 313a997591..9cdd26ace1 100644 --- a/go/cmd/dolt/commands/ci/import.go +++ b/go/cmd/dolt/commands/ci/import.go @@ -33,7 +33,7 @@ import ( var importDocs = cli.CommandDocumentationContent{ ShortDesc: "Import a Dolt continuous integration workflow file into the database", - LongDesc: "Import a Dolt continuous integration workflow file into the database", + LongDesc: "Import a Dolt continuous integration workflow file into the database and create a Dolt commit", Synopsis: []string{ "{{.LessThan}}file{{.GreaterThan}}", }, @@ -64,7 +64,7 @@ func (cmd ImportCmd) Docs() *cli.CommandDocumentation { // Hidden should return true if this command should be hidden from the help text func (cmd ImportCmd) Hidden() bool { - return true + return false } // ArgParser implements cli.Command. diff --git a/go/cmd/dolt/commands/ci/init.go b/go/cmd/dolt/commands/ci/init.go index f357995602..cad1b89de7 100644 --- a/go/cmd/dolt/commands/ci/init.go +++ b/go/cmd/dolt/commands/ci/init.go @@ -30,10 +30,8 @@ import ( var initDocs = cli.CommandDocumentationContent{ ShortDesc: "Creates database tables used to store continuous integration configuration", - LongDesc: "Creates database tables used to store continuous integration configuration", - Synopsis: []string{ - "{{.LessThan}}init{{.GreaterThan}}", - }, + LongDesc: "Creates database tables used to store continuous integration configuration and creates a Dolt commit", + Synopsis: []string{""}, } type InitCmd struct{} @@ -61,7 +59,7 @@ func (cmd InitCmd) Docs() *cli.CommandDocumentation { // Hidden should return true if this command should be hidden from the help text func (cmd InitCmd) Hidden() bool { - return true + return false } // ArgParser implements cli.Command. @@ -73,7 +71,8 @@ func (cmd InitCmd) ArgParser() *argparser.ArgParser { // Exec implements cli.Command. func (cmd InitCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv, cliCtx cli.CliContext) int { ap := cmd.ArgParser() - _, usage := cli.HelpAndUsagePrinters(cli.CommandDocsForCommandString(commandStr, initDocs, ap)) + help, usage := cli.HelpAndUsagePrinters(cli.CommandDocsForCommandString(commandStr, initDocs, ap)) + cli.ParseArgsOrDie(ap, args, help) if !cli.CheckEnvIsValid(dEnv) { return 1 diff --git a/go/cmd/dolt/commands/ci/ls.go b/go/cmd/dolt/commands/ci/ls.go index b1bbd55100..3de26dbd18 100644 --- a/go/cmd/dolt/commands/ci/ls.go +++ b/go/cmd/dolt/commands/ci/ls.go @@ -29,10 +29,10 @@ import ( ) var listDocs = cli.CommandDocumentationContent{ - ShortDesc: "List Dolt CI workflows", - LongDesc: "List Dolt CI workflows", + ShortDesc: "List Dolt continuous integration workflows", + LongDesc: "List Dolt continuous integration workflows", Synopsis: []string{ - "{{.LessThan}}ls{{.GreaterThan}}", + "", }, } @@ -61,7 +61,7 @@ func (cmd ListCmd) Docs() *cli.CommandDocumentation { // Hidden should return true if this command should be hidden from the help text func (cmd ListCmd) Hidden() bool { - return true + return false } // ArgParser implements cli.Command. @@ -73,7 +73,8 @@ func (cmd ListCmd) ArgParser() *argparser.ArgParser { // Exec implements cli.Command. func (cmd ListCmd) Exec(ctx context.Context, commandStr string, args []string, dEnv *env.DoltEnv, cliCtx cli.CliContext) int { ap := cmd.ArgParser() - _, usage := cli.HelpAndUsagePrinters(cli.CommandDocsForCommandString(commandStr, listDocs, ap)) + help, usage := cli.HelpAndUsagePrinters(cli.CommandDocsForCommandString(commandStr, listDocs, ap)) + cli.ParseArgsOrDie(ap, args, help) if !cli.CheckEnvIsValid(dEnv) { return 1 diff --git a/go/cmd/dolt/commands/ci/remove.go b/go/cmd/dolt/commands/ci/remove.go index c06ce7f590..0d2b1f984a 100644 --- a/go/cmd/dolt/commands/ci/remove.go +++ b/go/cmd/dolt/commands/ci/remove.go @@ -27,8 +27,8 @@ import ( ) var removeDocs = cli.CommandDocumentationContent{ - ShortDesc: "Remove a Dolt continuous integration workflow by name", - LongDesc: "Remove a Dolt continuous integration workflow by name", + ShortDesc: "Removes a Dolt continuous integration workflow by name", + LongDesc: "Removes a Dolt continuous integration workflow by name and creates a Dolt commit", Synopsis: []string{ "{{.LessThan}}workflow name{{.GreaterThan}}", }, @@ -59,7 +59,7 @@ func (cmd RemoveCmd) Docs() *cli.CommandDocumentation { // Hidden should return true if this command should be hidden from the help text func (cmd RemoveCmd) Hidden() bool { - return true + return false } // ArgParser implements cli.Command.