Skip to content

Commit 4067c82

Browse files
committed
feat(phoenix): Expose parsed arg tokens to apps that request them
Some shell apps care about what order the arguments appear in. When `parseArgs()` is called with `tokens: true`, it produces this `tokens` array which represents all the command line options and arguments, in order, which is useful for these more advanced cases.
1 parent 306014a commit 4067c82

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/phoenix/src/ansi-shell/arg-parsers/simple-parser.js

+2
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@ export default {
4343

4444
ctx.locals.values = result.values;
4545
ctx.locals.positionals = result.positionals;
46+
if (result.tokens)
47+
ctx.locals.tokens = result.tokens;
4648
}
4749
}

0 commit comments

Comments
 (0)