feat: allow spaces in CLI name for help output#42
Open
Rugvip wants to merge 1 commit intoprivatenumber:masterfrom
Open
feat: allow spaces in CLI name for help output#42Rugvip wants to merge 1 commit intoprivatenumber:masterfrom
Rugvip wants to merge 1 commit intoprivatenumber:masterfrom
Conversation
b7be6fc to
9f96714
Compare
Relax the script name validation to accept spaces, so that names like 'backstage-cli repo test' work for help generation. The name is used in help output and usage lines, not for command routing. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
9f96714 to
802111e
Compare
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.
Hello @privatenumber π, same context as privatenumber/type-flag#52
I'm wondering if this is a change you're open to. It relaxes the restriction on top-level CLI naming to allow spaces within the name. Our use-case is separation of the command hierarchy and individual definitions. The command implementations only parse the args provided to the command using
cleye, rather than the full process argv slice. There's a different layer that handles the command routing.The benefit of this change is that we can rely on the built-in
usagegeneration incleye, rather than needing to redefine it. For example, the following:Can be switched to this:
I was about to add a condition that restricts this to only be allowed if the
commandsoption is not present, but realized that it might still be useful to allow this at the top level, but keep the restriction within the commands of course.