Skip to content

Commit

Permalink
Merge pull request onlywei#28 from khipkin/master
Browse files Browse the repository at this point in the history
branch command now properly handles unknown flags
  • Loading branch information
onlywei committed Jan 6, 2015
2 parents 96e6f28 + 86bd5ba commit 294c63b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions js/controlbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,31 @@ define(['d3'], function () {

switch (arg) {
case '--remote':
case '-r':
this.info(
'This command normally displays all of your remote tracking branches.'
);
args.length = 0;
break;
case '--all':
case '-a':
this.info(
'This command normally displays all of your tracking branches, both remote and local.'
);
break;
case '--delete':
case '-d':
var name = args.pop();
this.historyView.deleteBranch(name);
break;
default:
var remainingArgs = [arg].concat(args);
args.length = 0;
this.historyView.branch(remainingArgs.join(' '));
if (arg.charAt(0) == '-') {
this.error();
} else {
var remainingArgs = [arg].concat(args);
args.length = 0;
this.historyView.branch(remainingArgs.join(' '));
}
}
}
},
Expand Down

0 comments on commit 294c63b

Please sign in to comment.