Skip to content

Commit e252a0d

Browse files
committed
fix: help argument for subcommand
1 parent e2af929 commit e252a0d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

images/diffs-example.png

-172 KB
Loading

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const showVersion = (): void => {
1515
};
1616

1717
const main = async (): Promise<void> => {
18-
const [, , firstArgument, secondArgument] = process.argv;
18+
const [, , firstArgument, ...otherArgs] = process.argv;
1919

2020
if (hasAnyArg(VERSION_ARGS_VALUES)) {
2121
showVersion();
@@ -28,7 +28,7 @@ const main = async (): Promise<void> => {
2828
return;
2929
}
3030

31-
if (HELP_ARGS_VALUES.includes(secondArgument)) {
31+
if (HELP_ARGS_VALUES.some((item) => otherArgs.includes(item))) {
3232
const createCLI = () => {
3333
if (ALL_COMMANDS.some((cmdClass) => cmdClass.COMMAND === firstArgument)) {
3434
return createCommand(firstArgument, false);

0 commit comments

Comments
 (0)