1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 15:17:58 +01:00

Add -types argument to :ext* commands.

This commit is contained in:
Kris Maglione
2011-06-01 17:19:55 -04:00
parent d34a7b27e4
commit 61aa32fd13
3 changed files with 27 additions and 4 deletions

View File

@@ -423,7 +423,7 @@ var Addons = Module("addons", {
else
dactyl.assert(name, _("error.argumentRequired"));
AddonManager.getAddonsByTypes(["extension"], dactyl.wrapCallback(function (list) {
AddonManager.getAddonsByTypes(args["-types"], dactyl.wrapCallback(function (list) {
if (!args.bang || command.bang) {
list = list.filter(function (extension) extension.name == name);
if (list.length == 0)
@@ -439,13 +439,22 @@ var Addons = Module("addons", {
}, {
argCount: "?", // FIXME: should be "1"
bang: true,
completer: function (context) {
completion.extension(context);
completer: function (context, args) {
completion.extension(context, args["-types"]);
context.filters.push(function ({ item }) ok(item));
if (command.filter)
context.filters.push(command.filter);
},
literal: 0
literal: 0,
options: [
{
names: ["-types", "-type", "-t"],
description: "The add-on types to operate on",
default: ["extension"],
completer: function (context, args) completion.addonType(context),
type: CommandOption.LIST
}
]
});
});
},