main: Error on arguments to version subcmd
This commit is contained in:
parent
fcb41107db
commit
f7623a2057
1 changed files with 3 additions and 0 deletions
3
main.go
3
main.go
|
|
@ -77,6 +77,9 @@ func run(ctx context.Context, ms *xmain.State) (err error) {
|
|||
case "fmt":
|
||||
return autofmt(ctx, ms)
|
||||
case "version":
|
||||
if len(ms.Opts.Flags.Args()) > 1 {
|
||||
return xmain.UsageErrorf("version subcommand accepts no arguments")
|
||||
}
|
||||
fmt.Println(version.Version)
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue