mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 16:38:50 +02:00
show commands Issue #63
This commit is contained in:
parent
f49937c935
commit
092a92b0b4
7 changed files with 154 additions and 7 deletions
|
@ -33,9 +33,9 @@ var instantCommands = [
|
|||
});
|
||||
}],
|
||||
[/^show$/, function(bits) {
|
||||
|
||||
lines = [
|
||||
var lines = [
|
||||
intl.str('show-command'),
|
||||
'<br/>',
|
||||
'show commands',
|
||||
'show solution',
|
||||
'show goal'
|
||||
|
@ -78,6 +78,20 @@ var instantCommands = [
|
|||
throw new CommandResult({
|
||||
msg: msg
|
||||
});
|
||||
}],
|
||||
[/^show +commands$/, function(bits) {
|
||||
var allCommands = getAllCommands();
|
||||
var lines = [
|
||||
intl.str('show-all-commands'),
|
||||
'<br/>'
|
||||
];
|
||||
_.each(allCommands, function(regex, command) {
|
||||
lines.push(command);
|
||||
});
|
||||
|
||||
throw new CommandResult({
|
||||
msg: lines.join('\n')
|
||||
});
|
||||
}]
|
||||
];
|
||||
|
||||
|
@ -99,6 +113,24 @@ var regexMap = {
|
|||
'undo': /^undo($|\s)/
|
||||
};
|
||||
|
||||
var getAllCommands = function() {
|
||||
var toDelete = [
|
||||
'mobileAlert'
|
||||
];
|
||||
|
||||
var allCommands = _.extend(
|
||||
{},
|
||||
require('../git/commands').regexMap,
|
||||
require('../level').regexMap,
|
||||
regexMap
|
||||
);
|
||||
_.each(toDelete, function(key) {
|
||||
delete allCommands[key];
|
||||
});
|
||||
|
||||
return allCommands;
|
||||
};
|
||||
|
||||
exports.instantCommands = instantCommands;
|
||||
exports.parse = util.genParseCommand(regexMap, 'processSandboxCommand');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue