You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm trying to call one command from inside another. Perhaps a weird use case but trying to have my-program wrapper call a couple child commands internally. It's working when it calls the command with no options but it's failing if I try to pass any options into the child command via program.exec( [ 'child-arg' ], options ).
To Reproduce
This is the "child" command setup:
module.exports=({ createCommand })=>{returncreateCommand('Run compliance for foo').option('--check-only','Only check compliance').action(async({ options, logger })=>{console.log('Running compliance checks and configuration for foo');});};
This snippet works and runs the foo command successfully.
module.exports=({ createCommand })=>{returncreateCommand('Run child commands all at once').option('--check-only','Only check compliance').action(async({ options, logger })=>{program.exec(['foo']);});};
This snippet, however, throws the error Unknown option --check-only. Did you mean --check-only ?.
module.exports=({ createCommand })=>{returncreateCommand('Run child commands all at once').option('--check-only','Only check compliance').action(async({ options, logger })=>{program.exec(['foo'],options);});};
Expected behavior
The options object should be passed into the child command and applied properly.
Actual behavior
Error is thrown: Unknown option --check-only. Did you mean --check-only ?.
Environment informations (please complete the following information):
OS: macOS
OS version: 11.6
Shell: zsh
Caporal version: 2.0.2
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm trying to call one command from inside another. Perhaps a weird use case but trying to have
my-program wrapper
call a couple child commands internally. It's working when it calls the command with no options but it's failing if I try to pass any options into the child command viaprogram.exec( [ 'child-arg' ], options )
.To Reproduce
This is the "child" command setup:
This snippet works and runs the
foo
command successfully.This snippet, however, throws the error
Unknown option --check-only. Did you mean --check-only ?
.Expected behavior
The
options
object should be passed into the child command and applied properly.Actual behavior
Error is thrown:
Unknown option --check-only. Did you mean --check-only ?
.Environment informations (please complete the following information):
The text was updated successfully, but these errors were encountered: