Skip to content

Commit

Permalink
fix: remove sub-command name when resolving nested
Browse files Browse the repository at this point in the history
pi0 committed Mar 31, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 267d9ea commit 47398f1
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
@@ -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) {
4 changes: 2 additions & 2 deletions src/command.ts
Original file line number Diff line number Diff line change
@@ -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),
});
}
}
@@ -77,7 +77,7 @@ export async function resolveSubCommand(
if (subCommand) {
return resolveSubCommand(
subCommand,
rawArgs.slice(subCommandArgIndex),
rawArgs.slice(subCommandArgIndex + 1),
cmd
);
}

0 comments on commit 47398f1

Please sign in to comment.