mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-17 01:45:47 +01:00
Update straggler commands to use CommandOption.
--HG-- extra : rebase_source : c151758b643249af238cb60d7b04ba2c1bb5dbc6
This commit is contained in:
@@ -582,9 +582,14 @@ const Player = Module("player", {
|
|||||||
{
|
{
|
||||||
argCount: "1",
|
argCount: "1",
|
||||||
completer: function (context) completion.mediaListSort(context),
|
completer: function (context) completion.mediaListSort(context),
|
||||||
options: [[["-order", "-o"], commands.OPTION_STRING,
|
options: [
|
||||||
function (arg) /^(up|down)$/.test(arg),
|
{
|
||||||
function () [["up", "Sort in ascending order"], ["down", "Sort in descending order"]]]]
|
names: ["-order", "-o"], type: CommandOption.STRING,
|
||||||
|
description: "Specify the sorting order of the given field",
|
||||||
|
validator: function (arg) /^(up|down)$/.test(arg),
|
||||||
|
completer: function () [["up", "Sort in ascending order"], ["down", "Sort in descending order"]]
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
// FIXME: use :add -q like cmus? (not very vim-like are it's multi-option commands) --djk
|
// FIXME: use :add -q like cmus? (not very vim-like are it's multi-option commands) --djk
|
||||||
|
|||||||
@@ -107,9 +107,9 @@ const Addressbook = Module("addressbook", {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
argCount: "+",
|
argCount: "+",
|
||||||
options: [[["-firstname", "-f"], commands.OPTION_STRING],
|
options: [{ names: ["-firstname", "-f"], type: CommandOption.STRING, description: "The first name of the contact" },
|
||||||
[["-lastname", "-l"], commands.OPTION_STRING],
|
{ names: ["-lastname", "-l"], type: CommandOption.STRING, description: "The last name of the contact" },
|
||||||
[["-name", "-n"], commands.OPTION_STRING]]
|
{ names: ["-name", "-n"], type: CommandOption.STRING, description: "The display name of the contact" }]
|
||||||
});
|
});
|
||||||
|
|
||||||
commands.add(["contacts", "addr[essbook]"],
|
commands.add(["contacts", "addr[essbook]"],
|
||||||
|
|||||||
@@ -423,8 +423,8 @@ const Mail = Module("mail", {
|
|||||||
let mailargs = {};
|
let mailargs = {};
|
||||||
mailargs.to = args.join(", ");
|
mailargs.to = args.join(", ");
|
||||||
mailargs.subject = args["-subject"];
|
mailargs.subject = args["-subject"];
|
||||||
mailargs.bcc = args["-bcc"];
|
mailargs.bcc = args["-bcc"] || [];
|
||||||
mailargs.cc = args["-cc"];
|
mailargs.cc = args["-cc"] || [];
|
||||||
mailargs.body = args["-text"];
|
mailargs.body = args["-text"];
|
||||||
mailargs.attachments = args["-attachment"] || [];
|
mailargs.attachments = args["-attachment"] || [];
|
||||||
|
|
||||||
@@ -441,11 +441,14 @@ const Mail = Module("mail", {
|
|||||||
mail.composeNewMail(mailargs);
|
mail.composeNewMail(mailargs);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
options: [[["-subject", "-s"], commands.OPTION_STRING],
|
// TODO: completers, validators - whole shebang. Do people actually use this? --djk
|
||||||
[["-attachment", "-a"], commands.OPTION_LIST],
|
options: [
|
||||||
[["-bcc", "-b"], commands.OPTION_STRING],
|
{ names: ["-subject", "-s"], type: CommandOption.STRING, description: "Subject line"},
|
||||||
[["-cc", "-c"], commands.OPTION_STRING],
|
{ names: ["-attachment", "-a"], type: CommandOption.LIST, description: "List of attachments"},
|
||||||
[["-text", "-t"], commands.OPTION_STRING]]
|
{ names: ["-bcc", "-b"], type: CommandOption.LIST, description: "Blind Carbon Copy addresses"},
|
||||||
|
{ names: ["-cc", "-c"], type: CommandOption.LIST, description: "Carbon Copy addresses"},
|
||||||
|
{ names: ["-text", "-t"], type: CommandOption.STRING, description: "Message body"}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
commands.add(["copy[to]"],
|
commands.add(["copy[to]"],
|
||||||
|
|||||||
Reference in New Issue
Block a user