mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 06:17: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:
@@ -91,11 +91,9 @@ liberator.IO = function () //{{{
|
||||
"Print the current directory name",
|
||||
function (args)
|
||||
{
|
||||
if (args)
|
||||
liberator.echoerr("E488: Trailing characters");
|
||||
else
|
||||
liberator.echo(liberator.io.getCurrentDirectory());
|
||||
});
|
||||
liberator.echo(liberator.io.getCurrentDirectory());
|
||||
},
|
||||
{ argCount: "0" });
|
||||
|
||||
// mkv[imperatorrc] or mkm[uttatorrc]
|
||||
liberator.commands.add(["mk" + extname.substr(0, 1) + "[" + extname.substr(1) + "rc]"],
|
||||
@@ -105,7 +103,9 @@ liberator.IO = function () //{{{
|
||||
// TODO: "E172: Only one file name allowed"
|
||||
var filename;
|
||||
if (args)
|
||||
{
|
||||
filename = args;
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = (navigator.platform == "Win32") ? "~/_" : "~/.";
|
||||
|
||||
Reference in New Issue
Block a user