commander
Advanced tools
Comparing version 9.4.0 to 9.4.1
@@ -108,4 +108,6 @@ const { InvalidArgumentError } = require('./error.js'); | ||
* Set environment variable to check for option value. | ||
* Priority order of option values is default < env < cli | ||
* | ||
* An environment variable is only used if when processed the current option value is | ||
* undefined, or the source of the current value is 'default' or 'config' or 'env'. | ||
* | ||
* @param {string} name | ||
@@ -112,0 +114,0 @@ * @return {Option} |
{ | ||
"name": "commander", | ||
"version": "9.4.0", | ||
"version": "9.4.1", | ||
"description": "the complete solution for node.js command-line programs", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -333,3 +333,3 @@ # Commander.js | ||
You may specify a required (mandatory) option using `.requiredOption`. The option must have a value after parsing, usually specified on the command line, or perhaps from a default value (say from environment). The method is otherwise the same as `.option` in format, taking flags and description, and optional default value or custom processing. | ||
You may specify a required (mandatory) option using `.requiredOption()`. The option must have a value after parsing, usually specified on the command line, or perhaps from a default value (say from environment). The method is otherwise the same as `.option()` in format, taking flags and description, and optional default value or custom processing. | ||
@@ -445,2 +445,4 @@ Example file: [options-required.js](./examples/options-required.js) | ||
Specify a required (mandatory) option using the `Option` method `.makeOptionMandatory()`. This matches the `Command` method [.requiredOption()](#required-option). | ||
### Custom option processing | ||
@@ -546,2 +548,4 @@ | ||
For safety, `.addCommand()` does not automatically copy the inherited settings from the parent command. There is a helper routine `.copyInheritedSettings()` for copying the settings when they are wanted. | ||
### Command-arguments | ||
@@ -548,0 +552,0 @@ |
@@ -147,3 +147,5 @@ // Type definitions for commander | ||
* Set environment variable to check for option value. | ||
* Priority order of option values is default < env < cli | ||
* | ||
* An environment variables is only used if when processed the current option value is | ||
* undefined, or the source of the current value is 'default' or 'config' or 'env'. | ||
*/ | ||
@@ -270,3 +272,3 @@ env(name: string): this; | ||
export type HookEvent = 'preSubcommand' | 'preAction' | 'postAction'; | ||
export type OptionValueSource = 'default' | 'env' | 'config' | 'cli'; | ||
export type OptionValueSource = 'default' | 'config' | 'env' | 'cli' | 'implied'; | ||
@@ -600,3 +602,3 @@ export interface OptionValues { | ||
*/ | ||
getOptionValueSource(key: string): OptionValueSource; | ||
getOptionValueSource(key: string): OptionValueSource | undefined; | ||
@@ -603,0 +605,0 @@ /** |
Sorry, the diff of this file is too big to display
170255
3659
1119