1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 09:27: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

@@ -88,6 +88,18 @@
<h2 tag="extensions add-ons">Add-ons</h2> <h2 tag="extensions add-ons">Add-ons</h2>
<p>
The following commands manipulate the currently installed
add-ons. With the exception of <ex>:extadd</ex>, they all except
the following arguments:
</p>
<dl>
<dt>-types</dt> <dd>The types of add-ons to operate on, the most
common types being <tt>extension</tt>, <tt>theme</tt>, and <tt>plugin</tt> (short names <em>-type</em>,
<em>-t</em>)</dd>
</dl>
<item> <item>
<tags>:exta :extadd</tags> <tags>:exta :extadd</tags>
<spec>:exta<oa>dd</oa> <a>file|url</a></spec> <spec>:exta<oa>dd</oa> <a>file|url</a></spec>

View File

@@ -423,7 +423,7 @@ var Addons = Module("addons", {
else else
dactyl.assert(name, _("error.argumentRequired")); 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) { if (!args.bang || command.bang) {
list = list.filter(function (extension) extension.name == name); list = list.filter(function (extension) extension.name == name);
if (list.length == 0) if (list.length == 0)
@@ -439,13 +439,22 @@ var Addons = Module("addons", {
}, { }, {
argCount: "?", // FIXME: should be "1" argCount: "?", // FIXME: should be "1"
bang: true, bang: true,
completer: function (context) { completer: function (context, args) {
completion.extension(context); completion.extension(context, args["-types"]);
context.filters.push(function ({ item }) ok(item)); context.filters.push(function ({ item }) ok(item));
if (command.filter) if (command.filter)
context.filters.push(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
}
]
}); });
}); });
}, },

View File

@@ -111,6 +111,8 @@
- Added :mksyntax command to auto-generate Vim syntax files. [b4] - Added :mksyntax command to auto-generate Vim syntax files. [b4]
- Added 's' and 'e' flags to :pageinfo command. [b7] - Added 's' and 'e' flags to :pageinfo command. [b7]
- Added :pintab and :unpintab commands. [b7] - Added :pintab and :unpintab commands. [b7]
- Extension manipulation commands, including :extenable, :extdisable,
and :exttoggle, now accept a -types argument.
- :tabmove now moves to the position of tab N, not after it. - :tabmove now moves to the position of tab N, not after it.
Without arguments it no longer moves the tab to the end of Without arguments it no longer moves the tab to the end of
the list. [b7] the list. [b7]