1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-01 04:12:26 +01:00

add "?" as the argCount to commands with an optional single arg

This commit is contained in:
Doug Kearns
2008-12-01 11:45:25 +00:00
parent a4361e49f8
commit ead1babb4d
6 changed files with 15 additions and 4 deletions

View File

@@ -341,6 +341,7 @@ function Bookmarks() //{{{
liberator.echo(deletedCount + " bookmark(s) with url `" + url + "' deleted", commandline.FORCE_SINGLELINE);
},
{
argCount: "?",
completer: function completer(context) completion.bookmark(context),
literal: 0
});
@@ -660,6 +661,7 @@ function History() //{{{
}
},
{
argCount: "?",
bang: true,
completer: function completer(context)
{
@@ -712,6 +714,7 @@ function History() //{{{
}
},
{
argCount: "?",
bang: true,
completer: function completer(context)
{

View File

@@ -523,6 +523,7 @@ function Buffer() //{{{
window.stylesheetSwitchAll(window.content, args);
},
{
argCount: "?",
completer: function (context) completion.alternateStylesheet(context),
literal: 0
});

View File

@@ -367,6 +367,7 @@ function IO() //{{{
autocommands.trigger("ShellCmdPost", {});
},
{
argCount: "?", // TODO: "1" - probably not worth supporting weird Vim edge cases. The dream is dead. --djk
bang: true,
completer: function (context) completion.shellCommand(context),
literal: 0

View File

@@ -273,7 +273,7 @@ const liberator = (function () //{{{
}
},
{
argCount: "+",
argCount: "1",
// TODO: add this as a standard menu completion function
completer: function (context)
{
@@ -326,9 +326,10 @@ const liberator = (function () //{{{
liberator.help(args.string);
},
{
argCount: "?",
bang: true,
completer: function (context) completion.help(context),
literal: 0
literal: 0 // FIXME: why literal?
});
commands.add(["javas[cript]", "js"],

View File

@@ -472,6 +472,7 @@ function Tabs() //{{{
}
},
{
argCount: "?",
bang: true,
count: true,
completer: function (context) completion.buffer(context),
@@ -481,7 +482,10 @@ function Tabs() //{{{
commands.add(["buffers", "files", "ls", "tabs"],
"Show a list of all buffers",
function (args) { tabs.list(args.literalArg); },
{ literal: 0 });
{
argCount: "?",
literal: 0
});
commands.add(["quita[ll]", "qa[ll]"],
"Quit " + config.name,
@@ -608,6 +612,7 @@ function Tabs() //{{{
window.undoCloseTab(count - 1);
},
{
argCount: "?",
completer: function (context)
{
context.keys = { text: function (item) item.state.entries[0].url, description: "title" };

View File

@@ -340,7 +340,7 @@ const config = { //{{{
liberator.echoerr("No sidebar " + args + " found");
},
{
argCount: "+",
argCount: "1",
completer: function (context) completion.sidebar(context),
literal: 0
});