Add focused CLI argument helpers
This commit is contained in:
@@ -13,14 +13,10 @@ func validateCommand(ctx context.Context, args []string, stdout, stderr io.Write
|
||||
printValidateHelp(stdout)
|
||||
return exitOK
|
||||
}
|
||||
if len(args) > 1 {
|
||||
fmt.Fprintf(stderr, "%s: validate accepts at most one path\n", app.Name)
|
||||
path, ok := parseOptionalPathArg(stderr, "validate", args)
|
||||
if !ok {
|
||||
return exitUsage
|
||||
}
|
||||
var path string
|
||||
if len(args) == 1 {
|
||||
path = args[0]
|
||||
}
|
||||
if err := app.Validate(ctx, app.ValidateOptions{Path: path, Stdout: stdout}); err != nil {
|
||||
return fail(stderr, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user