1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 14:27:59 +01:00

Cleanup horrible :map output. Update for map groups.

This commit is contained in:
Kris Maglione
2011-01-19 15:36:04 -05:00
parent 807c7a4aba
commit 067b8d2a6c
2 changed files with 41 additions and 23 deletions

View File

@@ -269,6 +269,7 @@ var Command = Class("Command", {
{
__iterator__: function () array.iterItems(this),
command: this,
explicitOpts: Class.memoize(function () ({})),
get literalArg() this.command.literal != null && this[this.command.literal] || "",
// TODO: string: Class.memoize(function () { ... }),
verify: function verify() {
@@ -396,7 +397,8 @@ var ex = {
let val = opt.type && opt.type.parse(v);
dactyl.assert(val != null && (typeof val !== "number" || !isNaN(val)),
"No such option: " + k);
res[opt.names[0]] = val;
Class.replaceProperty(args, opt.names[0], val);
args.explicitOpts[opt.names[0]] = val;
}
for (let [i, val] in array.iterItems(args))
res[i] = String(val);
@@ -921,6 +923,8 @@ var Commands = Module("commands", {
else
Class.replaceProperty(args, opt.names[0], opt.type == CommandOption.NOARG || arg);
args.explicitOpts[opt.names[0]] = args[opt.names[0]];
i += optname.length + count;
if (i == str.length)
break outer;