mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-21 03:05:31 +02:00
moar
This commit is contained in:
parent
8d42c362eb
commit
3bf34850ac
1 changed files with 14 additions and 6 deletions
|
@ -15,7 +15,8 @@ Command.prototype.getShortcutMap = function() {
|
||||||
'git commit': /^gc/,
|
'git commit': /^gc/,
|
||||||
'git add': /^ga/,
|
'git add': /^ga/,
|
||||||
'git checkout': /^gchk/,
|
'git checkout': /^gchk/,
|
||||||
'git rebase': /^gr/
|
'git rebase': /^gr/,
|
||||||
|
'git branch': /^gb/
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -28,6 +29,7 @@ Command.prototype.getRegexMap = function() {
|
||||||
checkout: /^checkout($|\s)/,
|
checkout: /^checkout($|\s)/,
|
||||||
rebase: /^rebase($|\s)/,
|
rebase: /^rebase($|\s)/,
|
||||||
reset: /^reset($|\s)/,
|
reset: /^reset($|\s)/,
|
||||||
|
branch: /^branch($|\s)/,
|
||||||
revert: /^revert($|\s)/
|
revert: /^revert($|\s)/
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -75,7 +77,9 @@ Command.prototype.parse = function(str) {
|
||||||
* OptionParser
|
* OptionParser
|
||||||
*/
|
*/
|
||||||
function OptionParser(method, options) {
|
function OptionParser(method, options) {
|
||||||
this.method = metho;d
|
this.method = method;
|
||||||
|
this.options = options;
|
||||||
|
|
||||||
this.supportedMap = this.getMasterOptionMap()[method];
|
this.supportedMap = this.getMasterOptionMap()[method];
|
||||||
this.unsupportedOptions = [];
|
this.unsupportedOptions = [];
|
||||||
|
|
||||||
|
@ -87,15 +91,19 @@ function OptionParser(method, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
OptionParser.prototype.getMasterOptionMap = function() {
|
OptionParser.prototype.getMasterOptionMap = function() {
|
||||||
// here a value of false means that we support it, even if its just a pass-through
|
// here a value of false means that we support it, even if its just a
|
||||||
// option. If the value is not here (aka will be undefined later), we do not
|
// pass-through option. If the value is not here (aka will be undefined
|
||||||
// support it
|
// when accessed), we do not support it.
|
||||||
return {
|
return {
|
||||||
commit: {
|
commit: {
|
||||||
'--amend': false,
|
'--amend': false,
|
||||||
'-a': false
|
'-a': false
|
||||||
},
|
},
|
||||||
add: {},
|
add: {},
|
||||||
|
branch: {
|
||||||
|
'-d': false,
|
||||||
|
'-D': false
|
||||||
|
},
|
||||||
checkout: {},
|
checkout: {},
|
||||||
reset: {
|
reset: {
|
||||||
'--hard': false,
|
'--hard': false,
|
||||||
|
@ -106,7 +114,7 @@ OptionParser.prototype.getMasterOptionMap = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
OptionParser.prototype.explodeAndSet = function() {
|
OptionParser.prototype.explodeAndSet = function() {
|
||||||
var exploded = this.str.split(' ');
|
var exploded = this.options.split(' ');
|
||||||
var options =[];
|
var options =[];
|
||||||
|
|
||||||
_.each(exploded, function(part) {
|
_.each(exploded, function(part) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue