mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-24 20:53:35 +01:00
Add bang support to :delgroup to delete all groups.
This commit is contained in:
@@ -189,10 +189,13 @@
|
|||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
|
<tags>:delgr :delgroup</tags>
|
||||||
<spec>:delgr<oa>oup</oa> <a>group</a></spec>
|
<spec>:delgr<oa>oup</oa> <a>group</a></spec>
|
||||||
|
<spec>:delgr<oa>oup</oa>!</spec>
|
||||||
<description>
|
<description>
|
||||||
<p>
|
<p>
|
||||||
Delete the specified <a>group</a>.
|
Delete the specified <a>group</a>. With <oa>!</oa> delete all
|
||||||
|
user groups.
|
||||||
</p>
|
</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -570,12 +570,21 @@ var Contexts = Module("contexts", {
|
|||||||
commands.add(["delg[roup]"],
|
commands.add(["delg[roup]"],
|
||||||
"Delete a group",
|
"Delete a group",
|
||||||
function (args) {
|
function (args) {
|
||||||
util.assert(contexts.getGroup(args[0]), _("group.noSuch", args[0]));
|
util.assert(args.bang ^ !!args[0], _("error.argumentOrBang"));
|
||||||
contexts.removeGroup(args[0]);
|
|
||||||
|
if (args.bang)
|
||||||
|
contexts.groupList = contexts.groupList.filter(function (g) g.builtin);
|
||||||
|
else {
|
||||||
|
util.assert(contexts.getGroup(args[0]), _("group.noSuch", args[0]));
|
||||||
|
contexts.removeGroup(args[0]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
argCount: "1",
|
argCount: "?",
|
||||||
|
bang: true,
|
||||||
completer: function (context, args) {
|
completer: function (context, args) {
|
||||||
|
if (args.bang)
|
||||||
|
return;
|
||||||
modules.completion.group(context);
|
modules.completion.group(context);
|
||||||
context.filters.push(function ({ item }) !item.builtin);
|
context.filters.push(function ({ item }) !item.builtin);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user