cli: add shorthand aliases to server and agent commands#6897
Draft
Pittu-Sharma wants to merge 4 commits into
Draft
cli: add shorthand aliases to server and agent commands#6897Pittu-Sharma wants to merge 4 commits into
Pittu-Sharma wants to merge 4 commits into
Conversation
Signed-off-by: pittu sharma <pittusharma47@gmail.com>
Signed-off-by: pittu sharma <pittusharma47@gmail.com>
This commit introduces short-form flag aliases across SPIRE server and agent command suites to improve CLI usability and align with standard conventions. Key updates: - Added reusable flag helpers in pkg/common/cli/flags.go - Integrated aliases into entry, bundle, healthcheck, and run commands - Updated documentation and test fixtures to reflect changes Signed-off-by: pittu sharma <pittusharma47@gmail.com>
Member
|
Thanks @Pittu-Sharma for opening this PR. We do want to have support for short flags, but we'd want to first switch to a flag library that has native support for this. This avoids the need to have both flags appear as separate options in the help output. If we do make this change, they would have to happen in a backwards compatible way so that no existing users encounter breaking changes. |
Member
|
@Pittu-Sharma, another option we could explore here is to modify the Usage variable to de-duplicate the output in the help line, so it could say something like: I don't know if it's going to work very well with our subcommands, but if it does and the help out still looks reasonable that may be a good way forward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request check list
Affected functionality
CLI flag parsing and help documentation for both SPIRE Server and SPIRE Agent.
Description of change
This PR introduces short-form flag aliases (shorthands) across the primary SPIRE command suites to improve usability and align with standard POSIX CLI conventions.
Key improvements:
pkg/common/cli/flags.gothat wrap the standard Goflagpackage to support aliases without introducing external dependencies.-cfor-config-dfor-dataDir-vfor-logLevel/-verbose-sfor-socketPath/-shallow-ifor-id/-spiffeID-pfor-parentID/-path/-namedPipeNamedoc/spire_server.mdanddoc/spire_agent.md.Which issue this PR fixes
fixes #6790