Skip to content

Rename Available Commands to Main Commands#4975

Merged
janniklasrose merged 5 commits into
mainfrom
janniklasrose/rename-available-commands
May 27, 2026
Merged

Rename Available Commands to Main Commands#4975
janniklasrose merged 5 commits into
mainfrom
janniklasrose/rename-available-commands

Conversation

@janniklasrose
Copy link
Copy Markdown
Contributor

@janniklasrose janniklasrose commented Apr 15, 2026

Changes

Rename command group Available Commands to Main Commands.

With the rename, if only one command group survives filtering, drop it so Cobra can default to Available Commands: again.

Why

If Management Commands and/or Permission Commands groups are present, it is a bit confusing from --help that they are also available (because customers might stop parsing the list after the Available Commands heading group ends)

before:

% databricks permissions --help
Usage:
  databricks permissions [flags]
  databricks permissions [command]

Available Commands
  get                   Get object permissions.
  set                   Set object permissions.
  update                Update object permissions.

Permission Commands
  get-permission-levels Get object permission levels.

after:

% ./cli permissions --help
Usage:
  databricks permissions [flags]
  databricks permissions [command]

Main Commands
  get                   Get object permissions.
  set                   Set object permissions.
  update                Update object permissions.

Permission Commands
  get-permission-levels Get object permission levels.

Flags:
  -h, --help   help for permissions

Tests

manual, see Why section above ^

@janniklasrose janniklasrose requested a review from pietern April 15, 2026 09:57
@janniklasrose janniklasrose marked this pull request as ready for review April 15, 2026 10:58
Comment thread cmd/cmd.go
{
ID: mainGroup,
Title: "Available Commands",
Title: "Main Commands",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also applicable to the account commands?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inconsistency with Cobra is unfortunate. Any chance we can address that as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pietern pietern requested a review from simonfaltum May 8, 2026 13:00
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
Copy link
Copy Markdown
Member

@simonfaltum simonfaltum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

Commit: 3239cdb

Run: 26498438846

@janniklasrose
Copy link
Copy Markdown
Contributor Author

Integration test failures are transient and unrelated (retried and inspected the errors)

@janniklasrose janniklasrose merged commit 1b60191 into main May 27, 2026
28 of 29 checks passed
@janniklasrose janniklasrose deleted the janniklasrose/rename-available-commands branch May 27, 2026 11:59
@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

Commit: 1b60191

Run: 26509835738

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants