-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Take this simple program:
program
.command('list')
.description('lists all objects')
.options('--name <name>', 'filter by name')
.action(function (options) {
// Program prints "filter enabled", even if user does not provide a value.
console.log(options.name ? 'filter enabled' : 'filter disabled');
})
The options object is not a raw property bag of the command line options, it is an object with some functions defined on it, one of which seems to be name, another is parent.
I feel like the API should be changed so there aren't hidden mines under certain option names -- or, at least, the documentation should make it clear what option names will conflict with these special API functions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels