diff --git a/src/args.ts b/src/args.ts index 95a616f..d764cd9 100644 --- a/src/args.ts +++ b/src/args.ts @@ -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, prop: string) { diff --git a/src/command.ts b/src/command.ts index 635976a..8777f83 100644 --- a/src/command.ts +++ b/src/command.ts @@ -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 ); }