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:
@@ -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"]]
|
||||
|
||||
Reference in New Issue
Block a user