forked from mitchellh/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only look for subcommands up to quoted with spaces
Fixes mitchellh#68 This changes the subcommand search behavior to only look up to the point where a space is found in a single arg. This doesn't break prior behavior because prior behavior would've resulted in a panic. Examples: 1. `./cli foo "bar baz"` would match subcommand "foo" and treat "bar baz" as a single argument to subcommand "foo". 2. `./cli "foo bar"` would have no subcommand. The reason I took this approach is because we otherwise treat quoted arguments with a space as a single argument (as do shells). This keeps that behavior in line.
- Loading branch information
Showing
2 changed files
with
109 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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