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

Don't include the default -description value when serializing commands.

This commit is contained in:
Doug Kearns
2009-06-04 17:05:53 +10:00
parent 7cb53db7da
commit bee39cacb7

View File

@@ -1120,8 +1120,10 @@ function Commands() //{{{
bang: true,
options: util.Array.toObject(
[[v, typeof cmd[k] == "boolean" ? null : cmd[k]]
for ([k, v] in Iterator({ argCount: "-nargs", bang: "-bang", count: "-count" }))
if (k in cmd && cmd[k] != "0")]),
// FIXME: this map is expressed multiple times
for ([k, v] in Iterator({ argCount: "-nargs", bang: "-bang", count: "-count", description: "-description" }))
// FIXME: add support for default values to parseArgs
if (k in cmd && cmd[k] != "0" && cmd[k] != "User-defined command")]),
arguments: [cmd.name],
literalArg: cmd.replacementText
}