Extends
Methods
(static) compareArgvToPatterns(argv, patterns, diff) → {ArgvArray}
Matches the argv parameters with the pattern, and returns the matches in [array ArgvArray].
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
argv |
string
|
Array
|
ArgvArray
|
Where string is the command line. Where Array- Argv array of command line parameters. Command line:
|
patterns |
string
|
Array
|
ArgvPattern
|
Where string is the command line. Where Array- Argv array of command line parameters. Command patterns:
|
diff |
boolean
|
Array
|
If set to false, it will give an error if the parameter set by the template is missing. If set empty array, then the missing parameter will be added to this array. |
Throws:
Error: Bad parameters - syntactically bad parameter or poorly constructed command line. Error: Throws an error if the parameter is set according to the pattern, but does not match the criteria of the pattern. Error: Throws an error if an extra parameter is passed. Throws an error if diff argument is false. Error: Throws an error if the parameter is required according to the pattern, but it is missing and the default value is not set in the pattern.
Returns:
- Type:
-
ArgvArray
parameters that intersect with the pattern
(static) compareArgvToPatterns(argv, patterns, diff) → {ArgvArray}
Matches the argv parameters with the pattern, and returns the matches in [array ArgvArray].
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
argv |
string
|
Array
|
ArgvArray
|
Where string is the command line. Where Array- Argv array of command line parameters. Command line:
|
patterns |
string
|
Array
|
ArgvPattern
|
Where string is the command line. Where Array- Argv array of command line parameters. Command patterns:
|
diff |
boolean
|
Array
|
If set to false, it will give an error if the parameter set by the template is missing. If set empty array, then the missing parameter will be added to this array. |
Throws:
Error: Bad parameters - syntactically bad parameter or poorly constructed command line. Error: Throws an error if the parameter is set according to the pattern, but does not match the criteria of the pattern. Error: Throws an error if an extra parameter is passed. Throws an error if diff argument is false. Error: Throws an error if the parameter is required according to the pattern, but it is missing and the default value is not set in the pattern.
Returns:
- Type:
-
ArgvArray
parameters that intersect with the pattern
(static) elementsToPattern(argv) → {string}
Converting [object ArgvElement] elements from [array ArgvArray] to command line pattern
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
argv |
ArgvArray
|
Throws:
Error: Bad argument - Invalid argument
Returns:
- Type:
-
string
Returns the assembled pattern
(static) elementsToPattern(argv) → {string}
Converting [object ArgvElement] elements from [array ArgvArray] to command line pattern
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
argv |
ArgvArray
|
Throws:
Error: Bad argument - Invalid argument
Returns:
- Type:
-
string
Returns the assembled pattern
(static) getHelp(argv, pattern, descriptions) → {string}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
argv |
||
pattern |
||
descriptions |
object
|
{ '-':'this desc', } |
Returns:
- Type:
-
string
(static) getHelp(argv, pattern, descriptions) → {string}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
argv |
||
pattern |
||
descriptions |
object
|
{ '-':'this desc', } |
Returns:
- Type:
-
string
compare(argv, diff) → {ArgvArray}
Matches the argv parameters with the pattern, and returns the matches in [array ArgvArray]. See [method Argv.compareArgvToPatterns].
- Source:
Parameters:
Name | Type | Description |
---|---|---|
argv |
string
|
Array
|
ArgvArray
|
argv parameters |
diff |
If set to false, it will give an error if the parameter set by the template is missing. If set empty array, then the missing parameter will be added to this array. |
Returns:
- Type:
-
ArgvArray
compare(argv, diff) → {ArgvArray}
Matches the argv parameters with the pattern, and returns the matches in [array ArgvArray]. See [method Argv.compareArgvToPatterns].
- Source:
Parameters:
Name | Type | Description |
---|---|---|
argv |
string
|
Array
|
ArgvArray
|
argv parameters |
diff |
If set to false, it will give an error if the parameter set by the template is missing. If set empty array, then the missing parameter will be added to this array. |
Returns:
- Type:
-
ArgvArray
toString() → {string}
Converting pattern array to string
- Source:
Returns:
- Type:
-
string
toString() → {string}
Converting pattern array to string
- Source:
Returns:
- Type:
-
string