command-line-args
Advanced tools
Comparing version 0.5.2 to 0.5.3
{ | ||
"name": "command-line-args", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "Command-line parser, usage text producer", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/75lb/command-line-args.git", |
@@ -32,3 +32,3 @@ [![view on npm](http://img.shields.io/npm/v/command-line-args.svg)](https://www.npmjs.org/package/command-line-args) | ||
/* generate a usage guide */ | ||
var usage = cli.usage({ | ||
var usage = cli.getUsage({ | ||
header: "A synopsis application.", | ||
@@ -79,13 +79,13 @@ footer: "For more information, visit http://example.com" | ||
<a name="module_command-line-args"></a> | ||
<a name="exp_module_command-line-args"></a> | ||
##class: CliArgs ⏏ | ||
**Members** | ||
* [class: CliArgs ⏏](#module_command-line-args) | ||
* [new CliArgs(options)](#module_command-line-args) | ||
* [class: CliArgs ⏏](#exp_module_command-line-args) | ||
* [new CliArgs(options)](#exp_new_module_command-line-args) | ||
* [cli.parse([argv])](#module_command-line-args#parse) | ||
* [cli.getUsage(options)](#module_command-line-args#getUsage) | ||
* [type: cli~OptionDefinition](#module_command-line-args.OptionDefinition) | ||
* [type: cli~OptionDefinition](#module_command-line-args..OptionDefinition) | ||
<a name="module_command-line-args"></a> | ||
<a name="exp_new_module_command-line-args"></a> | ||
###new CliArgs(options) | ||
@@ -96,3 +96,3 @@ A constructor function, taking your desired command-line option definitions as input, returning an instance of `command-line-args` which you can `parse()` or `getUsage()`. | ||
- options [Array.<OptionDefinition>](#module_command-line-args.OptionDefinition) - list of option definitions | ||
- options <code>[Array.<OptionDefinition>](#module_command-line-args..OptionDefinition)</code> - list of option definitions | ||
@@ -105,3 +105,3 @@ <a name="module_command-line-args#parse"></a> | ||
- [argv=process.argv] `object` - Optional argv array, pass to override the default `process.argv`. | ||
- \[argv=process.argv\] `object` - Optional argv array, pass to override the default `process.argv`. | ||
@@ -135,13 +135,21 @@ **Returns**: `object` | ||
- options `object` - options for template | ||
- title `string` - a title | ||
- header `string` - a header | ||
- footer `string` - a footer | ||
- forms `array` - the invocation forms | ||
- options `object` - options for template | ||
- title `string` - a title | ||
- header `string` - a header | ||
- footer `string` - a footer | ||
- forms `array` - the invocation forms | ||
**Returns**: `string` | ||
<a name="module_command-line-args.OptionDefinition"></a> | ||
<a name="module_command-line-args..OptionDefinition"></a> | ||
###type: cli~OptionDefinition | ||
Defines an option | ||
**Properties** | ||
- name `string` - the option name, used as the long option (e.g. `--name`) | ||
- type `function` - an optional function (e.g. `Number` or a custom function) used as a setter to enforce type. | ||
- alias `string` - a single character alias, used as the short option (e.g. `-n`) | ||
- defaultOption `boolean` - if values are specified without an option name, they are assigned to the defaultOption | ||
- description `string` - used in the usage guide | ||
**Scope**: inner typedef of [command-line-args](#module_command-line-args) | ||
@@ -148,0 +156,0 @@ **Type**: `object` |
Sorry, the diff of this file is not supported yet
29869
155