-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Init value of option '--name' is a [Function] #648
Comments
I create a workaround module for this problem: safe-commander |
There are a couple flags like this. |
@elliot-nelson you are right, too many options collide. That's for I could not wait for commander 3.x.x release and create safe-commander.js. Any feedback is welcome |
no issue - `--version` is a reserved option (see tj/commander.js#648). Same applies to `--name` etc. - We have to use `--v` for now. - This is in theory a breaking change, but the feature never worked when using `knex-migrator rollback --version x.x.x` in the shell - that's why it's a bug fix - updated docs
I worked around this limitation with the following (TypeScript, but probably similar in vanilla JS):
|
I have opened a Pull Request which allows storing option values separately rather than as command properties (access using See #1102 |
When a option
--name
is not set on CLI, initial value is a [Function]Example:
The ouput of
$ my-cli --name-prefix=test
is:The ouput of
$ my-cli --name=test
is:IMHO a widely use option like '--name' that collide with
[Command.name]
should have a dedicated check and initialization branch in code.The text was updated successfully, but these errors were encountered: