Rename Available Commands to Main Commands#4975
Conversation
| { | ||
| ID: mainGroup, | ||
| Title: "Available Commands", | ||
| Title: "Main Commands", |
There was a problem hiding this comment.
This is now a bit inconsistent with how Cobra behaves if there are no groups (it still prints Available Commands: in that case).
We could also do "Available Commands (Main)", "Available Commands (Permissions)", here
There was a problem hiding this comment.
Is this also applicable to the account commands?
There was a problem hiding this comment.
The inconsistency with Cobra is unfortunate. Any chance we can address that as well?
There was a problem hiding this comment.
As discussed on Slack:
To get Cobra to print
Available Commands:
Main Commands
get
set
Permission Commands
get-permission-levels
we'd need a custom template which is more maintenance than benefit here.
Renaming group 1 to Main is sufficient to avoid the confusion that there's more command groups below.
When configureGroups filters group definitions down to a single group, fall back to Cobra's default "Available Commands:" heading instead of emitting that lone group's title. This keeps the help output consistent with commands that don't define groups at all (e.g. databricks bundle). Co-authored-by: Isaac
simonfaltum
left a comment
There was a problem hiding this comment.
Looks good to me. The grouping fallback matches the intended behavior, and the updated acceptance outputs cover both the single-group fallback and one multi-group command.
Non-blocking suggestion: it would be useful to add a direct acceptance fixture for databricks permissions --help, since that is the motivating case and has the specific Main Commands + Permission Commands shape without a management group.
|
Commit: 3239cdb |
|
Integration test failures are transient and unrelated (retried and inspected the errors) |
|
Commit: 1b60191 |
Changes
Rename command group
Available CommandstoMain Commands.With the rename, if only one command group survives filtering, drop it so Cobra can default to
Available Commands:again.Why
If
Management Commandsand/orPermission Commandsgroups are present, it is a bit confusing from--helpthat they are also available (because customers might stop parsing the list after theAvailable Commandsheading group ends)before:
after:
Tests
manual, see Why section above ^