parser icon indicating copy to clipboard operation
parser copied to clipboard

Add stopParsing flag to arg

Open rizzlesauce opened this issue 5 years ago • 1 comments

When an arg is parsed that has the stopParsing flag set, the parser will stop trying to parse flags, and treat the rest of the input as arguments. One use of this feature is to support commands similar to yarn run and docker run, as in yarn run [<runFlags>] <script> [<args>], where <args> are not documented or known to yarn, they are simply passed on to the script being run.

The stopParsing flag allows an oclif command to behave similarly. You can configure a positional argument to be the end of the input that is parsed for flags, preventing oclif from detecting flags that occur afterward, allowing the command to exclusively handle the rest of the input through argv.

rizzlesauce avatar Sep 21 '19 04:09 rizzlesauce

Codecov Report

Merging #61 into master will decrease coverage by 1.45%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #61      +/-   ##
=========================================
- Coverage   91.35%   89.9%   -1.46%     
=========================================
  Files          11      11              
  Lines         324     307      -17     
  Branches       85      77       -8     
=========================================
- Hits          296     276      -20     
- Misses         12      15       +3     
  Partials       16      16
Impacted Files Coverage Δ
src/args.ts 100% <ø> (ø) :arrow_up:
src/parse.ts 89.51% <0%> (-1.92%) :arrow_down:
src/validate.ts 91.66% <0%> (-5.21%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 846cb4b...4b8625c. Read the comment docs.

codecov[bot] avatar Sep 21 '19 04:09 codecov[bot]