src/cli.js
/**
 * Perform operation specified via command-line arguments.
 * 
 * @param {Object} [options]
 *      Predefined values for command-line options.
 *      Each option specified in this object will be used only when the corresponding option is not set in command-line arguments.
 * @alias module:cli.cli
 * @see {@link module:cli.run run}
 */
Perform operation specified via command-line arguments.

@param {Object} [options]
Predefined values for command-line options.
Each option specified in this object will be used only when the corresponding option is not set in command-line arguments.
Perform operation specified via command - line arguments . @param { Object } [ options ] Predefined values for command - line options . Each option specified in this object will be used only when the corresponding option is not set in command - line arguments .
function cli(options) {
    var args = argParser.parse(),
        optionMap,
        sName,
        value;
    if (options) {
        optionMap = argParser.specs;
        for (sName in optionMap) {
            if (! (sName in args)) {
                if (sName in options) {
                    args[sName] = options[sName];
                }
                else {
                    value = optionMap[sName];
                    if (value.full in options) {
                        args[sName] = options[value.full];
                    }
                    else if (value.abbr in options) {
                        args[sName] = options[value.abbr];
                    }
                }
            }
        }
    }
    run(args);
}
function cli ( options ) { var args = argParser . parse ( ) , optionMap , sName , value ; if ( options ) { optionMap = argParser . specs ; for ( sName in optionMap ) { if ( ! ( sName in args ) ) { if ( sName in options ) { args [ sName ] = options [ sName ] ; } else { value = optionMap [ sName ] ; if ( value . full in options ) { args [ sName ] = options [ value . full ] ; } else if ( value . abbr in options ) { args [ sName ] = options [ value . abbr ] ; } } } } } run ( args ) ; }
Perform operation specified via command-line arguments.
Perform operation specified via command - line arguments .
// Use predefined values for absent arguments // Run CLI