Skip to content

Commit

Permalink
Fix default command
Browse files Browse the repository at this point in the history
  • Loading branch information
TomWright committed Oct 24, 2024
1 parent dd5953c commit 28d9744
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions internal/cli/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Globals struct {
type CLI struct {
Globals

Query QueryCmd `cmd:"" help:"[default] Execute a query"`
Query QueryCmd `cmd:"" default:"withargs" help:"[default] Execute a query"`
Version VersionCmd `cmd:"" help:"Print the version"`
}

Expand Down Expand Up @@ -51,16 +51,6 @@ func Run(stdin io.Reader, stdout, stderr io.Writer) (*kong.Context, error) {
k.Stderr = cli.Stderr
return nil
}),
kong.PostBuild(func(k *kong.Kong) error {
defaultCommandName := "query"
for _, c := range k.Model.Children {
if c.Name == defaultCommandName {
k.Model.DefaultCmd = c
break
}
}
return nil
}),
)
err := ctx.Run()
return ctx, err
Expand Down

0 comments on commit 28d9744

Please sign in to comment.