# new Options (commandNamestring, commandDescriptionstring, clioptString)

Arguments:
  • commandName: string
  • commandDescription: string
  • cli = 'ub': String

    An executable used to execute a command commandName. For example: ubcli

Methods

# add (otherOptionsOption) → Options instance

Add a option(s) definition.

Arguments:

# parse (defaultsoptObject, errorsoptArray) instance

Parse a command line & env variables for a options and create a configuration object. Return undefined in case options is not valid or a object with keys - options.long & values

Arguments:
  • defaults: Object

    Override for a command line attributes. If any - this one will be used

  • errors: Array

    If passed will bw filled by a errors in passed parameters

# parseVerbose (defaultsoptObject, outputParsedoptBoolean) instance

In case -help or '-?' command line switch found or passed options not match a options set will output a usage help to console and return undefined, else - return a parsed options

Arguments:
  • defaults: Object

    Override passed parameter values by this one

  • outputParsed = false: Boolean

    output a parsed parameters to a log

# usage () instance

Output a usage info to console