Skip to content

Commit 514015f

Browse files
ajcritesimhoffd
authored andcommitted
fix(executor): Exclude options for command argument parsing (#3798)
1 parent 4ee312a commit 514015f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/ionic/src/lib/executor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { AbstractExecutor, metadataOptionsToParseArgsOptions, parseArgs, stripOptions } from '@ionic/cli-framework';
22
import chalk from 'chalk';
3-
import * as lodash from 'lodash';
43

54
import { PROJECT_FILE } from '../constants';
65
import { CommandInstanceInfo, CommandMetadata, CommandMetadataInput, CommandMetadataOption, ICommand, INamespace } from '../definitions';
@@ -33,7 +32,10 @@ export class Executor extends AbstractExecutor<ICommand, INamespace, CommandMeta
3332
}
3433

3534
const cmd = location.obj;
36-
const cmdargs = lodash.drop(argv, location.path.length - 1);
35+
const path = location.path;
36+
const subcommandName = path[path.length - 1][0];
37+
const subcommandNameArgIdx = argv.findIndex(arg => arg === subcommandName);
38+
const cmdargs = argv.slice(subcommandNameArgIdx + 1);
3739

3840
await this.run(cmd, cmdargs, { location, env, executor: this });
3941
}

0 commit comments

Comments
 (0)