mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 04:07:58 +01:00
make use of our argsParser to handle commands with a fixed number of arguments.
Also added args.string to access the original string before it was parsed. TODO: Always pass a parseArgs-like structure to commands, instead of only when options or argCount is specified?
This commit is contained in:
@@ -727,27 +727,17 @@ liberator.Mail = function () //{{{
|
||||
"Empty trash of the current account",
|
||||
function (args, special)
|
||||
{
|
||||
if (args)
|
||||
{
|
||||
liberator.echoerr("E488: Trailing characters");
|
||||
return;
|
||||
}
|
||||
|
||||
goDoCommand("cmd_emptyTrash");
|
||||
});
|
||||
},
|
||||
{ argCount: "0" });
|
||||
|
||||
liberator.commands.add(["get[messages]"],
|
||||
"Check for new messages",
|
||||
function (args, special)
|
||||
{
|
||||
if (args)
|
||||
{
|
||||
liberator.echoerr("E488: Trailing characters");
|
||||
return;
|
||||
}
|
||||
|
||||
liberator.mail.getNewMessages(!special);
|
||||
});
|
||||
},
|
||||
{ argCount: "0" });
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////}}}
|
||||
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user