lib/utils/command-line-utils.js
function() {
    var cmdArguments = process.argv.slice(2)
    var lookup = {
        values: [],
        keyValues: {}
    };
    
    cmdArguments.forEach(function(cmdArgument) {
        var keyValue = cmdArgument.split('=');
        //Flag of key value type
        if(typeof keyValue[0] === 'string' && keyValue[0].charAt(0) === '-') {
            var value = keyValue.length === 2 ? _removeQuotes(keyValue[1]) : true;
            var keyName = keyValue[0];
            lookup.keyValues[keyName] = value;
        //Value type
        } else {
            lookup.values.push(_removeQuotes(cmdArgument));
        }
    })
    
    return lookup;
}
function() {
    var cmdArguments = process.argv.slice(2)
    var lookup = {
        values: [],
        keyValues: {}
    };
    
    cmdArguments.forEach(function(cmdArgument) {
        var keyValue = cmdArgument.split('=');
        //Flag of key value type
        if(typeof keyValue[0] === 'string' && keyValue[0].charAt(0) === '-') {
            var value = keyValue.length === 2 ? _removeQuotes(keyValue[1]) : true;
            var keyName = keyValue[0];
            lookup.keyValues[keyName] = value;
        //Value type
        } else {
            lookup.values.push(_removeQuotes(cmdArgument));
        }
    })
    
    return lookup;
}
function ( ) { var cmdArguments = process . argv . slice ( 2 ) var lookup = { values : [ ] , keyValues : { } } ; cmdArguments . forEach ( function ( cmdArgument ) { var keyValue = cmdArgument . split ( '=' ) ; //Flag of key value type if ( typeof keyValue [ 0 ] === 'string' && keyValue [ 0 ] . charAt ( 0 ) === '-' ) { var value = keyValue . length === 2 ? _removeQuotes ( keyValue [ 1 ] ) : true ; var keyName = keyValue [ 0 ] ; lookup . keyValues [ keyName ] = value ; //Value type } else { lookup . values . push ( _removeQuotes ( cmdArgument ) ) ; } } ) return lookup ; }
Create lookup table for process arguments
@result object
Create lookup table for process arguments