1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 05:57:59 +01:00

make sure the usage property of an Option is always set

This commit is contained in:
Doug Kearns
2007-08-21 11:29:14 +00:00
parent 3a976df75f
commit c46e912114

View File

@@ -33,6 +33,7 @@ function Option(names, type, extra_info) //{{{
this.name = names[0];
this.names = names;
this.usage = this.names;
this.type = type;
this.setter = function(value) { Options.setPref(this.name, value); };
@@ -42,8 +43,6 @@ function Option(names, type, extra_info) //{{{
{
if (extra_info.usage)
this.usage = extra_info.usage;
else
this.usage = this.names;
this.help = extra_info.help || null;
this.short_help = extra_info.short_help || null;
@@ -64,9 +63,10 @@ function Option(names, type, extra_info) //{{{
}
// add noOPTION variant of boolean OPTION to this.names
// FIXME: are these variants really considered names?
if (this.type == "boolean")
{
this.names = [];
this.names = []; // reset since order is important
for (var i = 0; i < names.length; i++)
{
this.names.push(names[i]);