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
Option with default value and global: true doesn't work.
To Reproduce
Steps to reproduce the behavior:
#!/usr/bin/env node
const{ program }=require("@caporal/core");program.option("--env","Set env vars",{global: true,// this causes the problemdefault: "dev",});program.action(({ options })=>{console.log(options);});program.run();
Expected behavior
When no value is provided, I expect the default value of the option to be set:
node index.js
{ env: true }
But this doesn't happen when global: true is set.
Actual behavior
The options object is empty:
node index.js
{ }
Environment informations (please complete the following information):
OS: Mac
OS version: 11.2.2
Shell: bash
Caporal version: 2.0.2
Additional context
The meaning of global: true is in the docs, but it isn't discussed in any detail, so I may be misinterpreting its purpose.
The text was updated successfully, but these errors were encountered:
Describe the bug
Option with default value and
global: true
doesn't work.To Reproduce
Steps to reproduce the behavior:
Expected behavior
When no value is provided, I expect the default value of the option to be set:
node index.js { env: true }
But this doesn't happen when
global: true
is set.Actual behavior
The options object is empty:
Environment informations (please complete the following information):
Additional context
The meaning of
global: true
is in the docs, but it isn't discussed in any detail, so I may be misinterpreting its purpose.The text was updated successfully, but these errors were encountered: