Skip to content

Support subcommands when querying for help #620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2021

Conversation

natecook1000
Copy link
Member

@natecook1000 natecook1000 commented Apr 29, 2021

Currently, running swift help package (when the swift-help from this package is installed) prints the help screen for the swift package command. However, subcommands and sub-subcommands are not accessible:

$ swift help package clean
Error: Unexpected argument 'clean'
Usage: swift-help [<topic>] [-show-hidden]
  See 'swift-help --help' for more information.

This adds an array that captures additional subcommands and passes them along to the matched command:

$ swift help package clean
OVERVIEW: Delete build artifacts

USAGE: swift package clean [<options>] --enable-index-store

OPTIONS:
  -Xcc <Xcc>              Pass flag through to all C compiler invocations 
  -Xswiftc <Xswiftc>      Pass flag through to all Swift compiler invocations 
  -Xlinker <Xlinker>      Pass flag through to all linker invocations 
  ....

@natecook1000 natecook1000 requested a review from owenv April 29, 2021 20:47
Copy link
Contributor

@owenv owenv left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks!

@natecook1000
Copy link
Member Author

@swift-ci Please test

@natecook1000 natecook1000 merged commit 5156317 into main May 4, 2021
@natecook1000 natecook1000 deleted the nate/swift_help_subcommands branch May 4, 2021 03:46
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.

3 participants