cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantanapr <>
Subject [GitHub] cordova-lib pull request: CB-6481 Add unified hooks support for co...
Date Thu, 14 Aug 2014 20:21:33 GMT
Github user csantanapr commented on the pull request:
    @sgrebnov here some feedback about context.cmdLine
    Any strong reason why this has to be a string instead of an Array like process.argv ?
        this.cmdLine =  process.argv.join(' ');
    I want to parse but I don't feel comfortable doing a split(' ') on spaces because the
parameter I'm looking for is a path and path can have spaces specially in Windows :-)
    Can we make context.cmdLine be process.argv and not a String or add a context.cmdArgv
to Context Class.
    This is what I have and don't like the idea of converting to Array with split on spaces
    var cmdLine = context.cmdLine.split(' ').filter(function(item){
        return item !== '--';
      var knowOpts = {'wlpath': path};
      var shortHands = {'wl' : '--wlpath'};
      var parsedCmdLine = nopt(knowOpts, shortHands, cmdLine, 0);
        console.log('Updating Worklight App path to;'+parsedCmdLine.wlpath);
        wlappPath = parsedCmdLine.wlpath;
    Oh one thing weird about using nopt is if  dash dash <space> '-- ' is present nopt
doesn't parse correctly, that's why I'm using a filter 
    Let me know what you think

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message