lots of minor bug fixes and tweaks to the command line

This commit is contained in:
Joe Walker 2010-12-15 18:54:25 +00:00
commit 21dce2784e
5 changed files with 131 additions and 95 deletions

View file

@ -158,8 +158,13 @@ SelectionType.prototype.parse = function(str) {
return new Conversion(matchedValue);
}
else {
// This is something of a hack. settings
if (this.noMatch) {
this.noMatch();
}
if (completions.length > 0) {
var msg = 'Several possibilities' +
var msg = 'Possibilities' +
(str.length === 0 ? '' : ' for \'' + str + '\'');
return new Conversion(null, Status.INCOMPLETE, msg, completions);
}

View file

@ -66,6 +66,9 @@ var setting = new SelectionType({
fromString: function(str) {
lastSetting = settings.getSetting(str);
return lastSetting;
},
noMatch: function() {
lastSetting = null;
}
});
@ -76,7 +79,12 @@ var setting = new SelectionType({
var settingValue = new DeferredType({
name: 'settingValue',
defer: function() {
return lastSetting.type;
if (lastSetting) {
return lastSetting.type;
}
else {
return types.getType('text');
}
}
});