This repository has been archived by the owner on Jan 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Dash-Separated Compound Commands
Summary: As I've been working on the e2e cli test suite, I've seen that there are issues with the way that the CLI Parses compound commands, which means that the parsing can terminate early and not parse the entire string. I think this highlights the folly in 'implicit' chaining of compound commands. For example, ``` list boot listen --http 1000 shutdown ``` Should result in the same parsed command as with dash-separated compound commands: ``` list -- boot -- listen --http 1000 -- shutdown ``` But it does not, as the dash separated style will bail out in parsing halfway through and provided a half-parsed result. I want to correct the existing behaviour, then remove 'implicit' parsing: 1) Introduce tests (and fixes) for dash-separated compound commands 2) Make parsing of compound commands 'strict'. This means that `list -- boot ThisIsABadArgument` should fail to parse instead of just parsing `list` and then continuing. This is important as this can result in very surprising behaviour otherwise. 3) Update any documentation and dependencies to use the new dash-separation of compound commands. 4) Remove the behaviour for implicit chaining of compound commands. Iinvert the tests so that dash-separation succeeds to parse, implicit chaining fails. This diff does #1 and #2 in unison, since only doing #1 without #2 results in a very confusing parser. Reviewed By: asm89 Differential Revision: D3592485 fbshipit-source-id: 00d3164c921082638d65076329b117c19ee57bf8
- Loading branch information
1 parent
a4c77fc
commit f7f5178
Showing
3 changed files
with
101 additions
and
30 deletions.
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
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