From 4067c82486c99cad20f41927ad39ebea438b717f Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 31 May 2024 10:07:24 +0100 Subject: [PATCH] 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. --- packages/phoenix/src/ansi-shell/arg-parsers/simple-parser.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/phoenix/src/ansi-shell/arg-parsers/simple-parser.js b/packages/phoenix/src/ansi-shell/arg-parsers/simple-parser.js index 2d806b00..d853d905 100644 --- a/packages/phoenix/src/ansi-shell/arg-parsers/simple-parser.js +++ b/packages/phoenix/src/ansi-shell/arg-parsers/simple-parser.js @@ -43,5 +43,7 @@ export default { ctx.locals.values = result.values; ctx.locals.positionals = result.positionals; + if (result.tokens) + ctx.locals.tokens = result.tokens; } }