modules/cli.js
function castArgument(arg) {
    "use strict";
    if (arg.match(/^-?\d+$/)) {
        return parseInt(arg, 10);
    } else if (arg.match(/^-?\d+\.\d+$/)) {
        return parseFloat(arg);
    } else if (arg.match(/^(true|false)$/i)) {
        return arg.trim().toLowerCase() === "true" ? true : false;
    } else {
        return arg;
    }
}
function castArgument(arg) {
    "use strict";
    if (arg.match(/^-?\d+$/)) {
        return parseInt(arg, 10);
    } else if (arg.match(/^-?\d+\.\d+$/)) {
        return parseFloat(arg);
    } else if (arg.match(/^(true|false)$/i)) {
        return arg.trim().toLowerCase() === "true" ? true : false;
    } else {
        return arg;
    }
}
function castArgument ( arg ) { "use strict" ; if ( arg . match ( / ^-?\d+$ / ) ) { return parseInt ( arg , 10 ) ; } else if ( arg . match ( / ^-?\d+\.\d+$ / ) ) { return parseFloat ( arg ) ; } else if ( arg . match ( / ^(true|false)$ / i ) ) { return arg . trim ( ) . toLowerCase ( ) === "true" ? true : false ; } else { return arg ; } }
Cast a string argument to its typed equivalent.

@param  String  arg
@return Mixed
Cast a string argument to its typed equivalent .