Repository navigation
Fix docc-reference rendering of short and single-dash names - #991
Open
awaisdev5765 wants to merge 2 commits into
Open
awaisdev5765 wants to merge 2 commits into
awaisdev5765 wants to merge 2 commits into
Conversation
generate-docc-reference previously filtered argument names to long names only and hardcoded the '--' prefix, so flags and options declared with only a short name or a single-dash long name rendered as a bare '--' in both the usage synopsis and the argument list. Names are now rendered with the dash prefix matching their kind (like generate-manual does), preferring long names when available to keep existing output stable. A new 'name-varieties' example exercises every name kind, with snapshot tests covering both markdown styles. Fixes apple#989
Bash function names may not contain hyphens; replace hyphens with underscores in helper and per-command completion function names and in the complete -F registration. Subcommand names in case statements are unaffected.
This branch has not been deployed
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.
Fixes #989
Problem
generate-docc-referencefiltered argument names to long names only and hardcoded the--prefix, so flags and options declared with only a short name or a single-dash long name rendered as a bare--in both the usage synopsis and the argument list.Fix
Names are now rendered with the dash prefix matching their kind, the same way
generate-manualdoes (ArgumentInfoV0.NameInfoV0→-v/-level/--verbose). Long names are still preferred when available, so output for existing tools is unchanged.Before
After
Testing
name-varietiesexample exercising every name kind: short-only flag, short+long flag, short-only option, single-dash-long option, and long-only option.nameVarietiesMarkdownReferenceandnameVarietiesDoccReferencesnapshot tests covering both output styles.