1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-23 16:23:30 +01:00

Make use of the new default property of CommandOption in :sortview.

--HG--
extra : rebase_source : 4b616d19e9b74229c65738be500653c075ea62e8
This commit is contained in:
Doug Kearns
2010-11-05 00:45:31 +11:00
parent 34eba352da
commit 64c96436eb

View File

@@ -574,8 +574,7 @@ const Player = Module("player", {
commands.add(["sort[view]"],
"Sort the current media view",
function (args) {
let order = args["-order"] || "up";
player.sortBy(args[0], order == "up");
player.sortBy(args[0], args["-order"] == "up");
},
{
argCount: "1",
@@ -583,6 +582,7 @@ const Player = Module("player", {
options: [
{
names: ["-order", "-o"], type: CommandOption.STRING,
default: "up",
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"]]