carvel-dev / carvel-dev/kapp

Remove Error Message from Only Executing Root Command

Open
#157 2 comments 1 reaction 0 assignees View on GitHub
discussion
Dominant language
Go
Stars
1.1k
Forks
134
PR merge metrics
No merged PRs in 30d

Description

With other cli tools, it is common to be able to execute the root command of the cli to display the help message. `kapp` currently does this, but it displays an error if no subcommand is called:

```
kapp: Error: Invalid command - see available commands/subcommands above
```

Would it make sense to not display this message since running the command is not an error? Maybe adding in something like below to `kapp.go` would help with this to avoid confusion about an error occurring.

```go
hasArgs := len(os.Args) > 1
if err != nil && hasArgs {
confUI.ErrorLinef("kapp: Error: %v", uierrs.NewMultiLineError(err))
return err
}

if hasArgs {
confUI.PrintLinef("Succeeded")
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.