Skip to content

Commit

Permalink
fix: remove sub-command name when resolving nested
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 31, 2023
1 parent 267d9ea commit 47398f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function parseArgs(rawArgs: string[], argsDef: ArgsDef): ParsedArgs {
}

const parsed = parseRawArgs(rawArgs, parseOptions);
const [, ...positionalArguments] = parsed._;
const [...positionalArguments] = parsed._;

const parsedArgsProxy = new Proxy(parsed, {
get(target: ParsedArgs<any>, prop: string) {
Expand Down
4 changes: 2 additions & 2 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function runCommand(
const subCommand = await resolveValue(subCommands[subCommandName]);
if (subCommand) {
await runCommand(subCommand, {
rawArgs: opts.rawArgs.slice(subCommandArgIndex),
rawArgs: opts.rawArgs.slice(subCommandArgIndex + 1),
});
}
}
Expand All @@ -77,7 +77,7 @@ export async function resolveSubCommand(
if (subCommand) {
return resolveSubCommand(
subCommand,
rawArgs.slice(subCommandArgIndex),
rawArgs.slice(subCommandArgIndex + 1),
cmd
);
}
Expand Down

0 comments on commit 47398f1

Please sign in to comment.