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