Package Exports
- command-line-tool
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (command-line-tool) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
command-line-tool
Some conventional operations used in command-line tools.
CommandLineTool ⏏
tool.stop([message])
Print the supplied messages then stop the process (no exit code).
Kind: instance method of CommandLineTool
Param | Type | Description |
---|---|---|
[message] | string | Array.<string> |
One or more messages to be written to stderr before exiting. May contain ansi.format markup. |
tool.printError(message)
Prints one or more strings in red to stderr.
Kind: instance method of CommandLineTool
Param | Type | Description |
---|---|---|
message | string | Array.<string> |
input message(s) |
tool.halt([err], [options])
Stop the process with an error message.
Kind: instance method of CommandLineTool
Param | Type | Description |
---|---|---|
[err] | Error |
the error instance |
[options] | object |
|
[options.exitCode] | number |
defaults to 1 |
[options.stack] | boolean |
defaults to false |
tool.getCli(definitions, [usageSections], [argv]) ⇒ object
Parse the command-line options.
Kind: instance method of CommandLineTool
Param | Type | Description |
---|---|---|
definitions | Array.<OptionDefinitions> |
to be passed to command-line-args |
[usageSections] | Array.<section> |
to be passed to command-line-usage |
[argv] | Array.<string> |
If supplied, this argv array is parsed instead of process.argv . |
© 2015-16 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.