Skip to content

Commit

Permalink
/go/cmd/dolt/commands/ci: unhide commands, fix help text
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeegoddd committed Jan 7, 2025
1 parent dab16ea commit a73e09c
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion go/cmd/dolt/commands/ci/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down
11 changes: 6 additions & 5 deletions go/cmd/dolt/commands/ci/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}",
"",
},
}

Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions go/cmd/dolt/commands/ci/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}",
},
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions go/cmd/dolt/commands/ci/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}",
},
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 5 additions & 6 deletions go/cmd/dolt/commands/ci/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
11 changes: 6 additions & 5 deletions go/cmd/dolt/commands/ci/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}",
"",
},
}

Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions go/cmd/dolt/commands/ci/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}}",
},
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a73e09c

Please sign in to comment.