Skip to content

Add custom helpNames support for Subcommand#251

Merged
natecook1000 merged 3 commits into
apple:mainfrom
Zoha131:customHelp
Jan 16, 2021
Merged

Add custom helpNames support for Subcommand#251
natecook1000 merged 3 commits into
apple:mainfrom
Zoha131:customHelp

Conversation

@Zoha131
Copy link
Copy Markdown
Contributor

@Zoha131 Zoha131 commented Oct 23, 2020

Modifying help flag names now works for subcommand. If not specified helpNames is inherited from parent. This PR is compatible with the current system.

Fix #215

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

If helpNames is not modified, Subcommand will inherit helpNames from its immediate parent.
The helpNames is generated from `commandStack: [ParsableCommand.Type]`.
`getHelpNames()` extension method of `Array` is order sensitive and assumes that the element of `commandStack`  at indexed `i` is the parent of the element at indexed `i+1`
@natecook1000
Copy link
Copy Markdown
Member

Thanks so much for fixing this, @Zoha131! 👏

@natecook1000
Copy link
Copy Markdown
Member

@swift-ci Please test

@natecook1000 natecook1000 merged commit d80c017 into apple:main Jan 16, 2021
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.

Modifying help flag names does not work for subcommands

2 participants