mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 21:22:26 +01:00
make sure all calls to command actions use sensible defaults
This commit is contained in:
@@ -86,6 +86,11 @@ liberator.Command.prototype = {
|
|||||||
|
|
||||||
execute: function (args, special, count, modifiers)
|
execute: function (args, special, count, modifiers)
|
||||||
{
|
{
|
||||||
|
// XXX
|
||||||
|
special = !!special;
|
||||||
|
count = (count === undefined) ? -1 : count;
|
||||||
|
modifiers = modifiers || {};
|
||||||
|
|
||||||
// whenever the user specifies special options or fixed number of arguments
|
// whenever the user specifies special options or fixed number of arguments
|
||||||
// we use our args parser instead of passing a string to the callback
|
// we use our args parser instead of passing a string to the callback
|
||||||
if (this.options.length > 0 || this.argCount)
|
if (this.options.length > 0 || this.argCount)
|
||||||
|
|||||||
@@ -482,10 +482,7 @@ liberator.Options = function () //{{{
|
|||||||
if (name == "all")
|
if (name == "all")
|
||||||
all = true;
|
all = true;
|
||||||
|
|
||||||
var scope = liberator.options.OPTION_SCOPE_BOTH;
|
var scope = modifiers.scope || liberator.options.OPTION_SCOPE_BOTH;
|
||||||
if (modifiers && modifiers.scope)
|
|
||||||
scope = modifiers.scope;
|
|
||||||
|
|
||||||
var option = liberator.options.get(name, scope);
|
var option = liberator.options.get(name, scope);
|
||||||
|
|
||||||
if (!option && !all)
|
if (!option && !all)
|
||||||
|
|||||||
Reference in New Issue
Block a user