Skip to content

Commit

Permalink
[TIMOB-19281] Fixed bug where the command line args weren't being par…
Browse files Browse the repository at this point in the history
…sed again after handling a branching option.
  • Loading branch information
cb1kenobi committed Aug 4, 2015
1 parent 7b632c0 commit 2bcae40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
4.1.x (Unreleased)
-------------------
* Fixed bug where the command line args weren't being parsed again after handling a branching option [TIMOB-19281]

4.0.1 (Unreleased)
-------------------
* Fixed bug with building an app that had a different Titanium SDK version than the selected SDK and abbreviated option names were being used [TIMOB-18826]
Expand Down
5 changes: 5 additions & 0 deletions lib/context.js
Expand Up @@ -551,6 +551,8 @@ Context.prototype.load = function load(logger, config, cli, callback) {
argv[name] && copyFlagsOptions.call(this, optionBranch[argv[name]]);

if (isHelpCommand || argv[name] !== undefined || !option.required) {
// we have to parse again in the event --<option> was passed in
this.parse(cli.argv.$_, [this.name]);
return next();
}

Expand Down Expand Up @@ -591,6 +593,9 @@ Context.prototype.load = function load(logger, config, cli, callback) {
// mix in the option branch's flags/options
copyFlagsOptions.call(this, optionBranch[value]);

// parse the args again now that we have a value and other options may have been added
this.parse(cli.argv.$_, [this.name]);

next();
}.bind(this));
}.bind(this));
Expand Down

0 comments on commit 2bcae40

Please sign in to comment.