If you have a command and a sub command with the same option, then when you
invoke program command subcommand -o option
the subcommand will not receive
the option.
When you invoke program command subcommand -o option
the subcommand recieves
the options passed, just like the command does.
- Clone this repo
- Run your package manager install of choice e.g.
pnpm i
- Run
node index.js say -m hello
to see the main command output - Run
node index.js say yellow -m hello
to see the sub command output - Observe that the sub command does not have any options passed to it
To see that the sub command does work, you can run the command
node main.js say yellow -y hello
.
version: 9.4.1