1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 18:47:59 +01:00

Fix ':set' to only show the nondefault entries

This commit is contained in:
Daniel Bainton
2008-12-05 09:26:20 +02:00
parent 4e621740af
commit 3bd42aafb5

View File

@@ -563,18 +563,28 @@ function Options() //{{{
{
let bang = args.bang;
if (!args.length)
args[0] = "all";
args[0] = "";
for (let [,arg] in args)
{
if (bang)
{
var onlyNonDefault = false;
var reset = false;
var invertBoolean = false;
let [matches, name, postfix, valueGiven, operator, value] =
arg.match(/^\s*?([a-zA-Z0-9\.\-_{}]+)([?&!])?\s*(([-+^]?)=(.*))?\s*$/);
let reset = (postfix == "&");
let invertBoolean = (postfix == "!");
if (args[0] == "")
{
var name = "all";
onlyNonDefault = true;
}
else
{
var [matches, name, postfix, valueGiven, operator, value] =
arg.match(/^\s*?([a-zA-Z0-9\.\-_{}]+)([?&!])?\s*(([-+^]?)=(.*))?\s*$/);
reset = (postfix == "&");
invertBoolean = (postfix == "!");
}
if (name == "all" && reset)
liberator.echoerr("You can't reset all options, it could make " + config.hostApplication + " unusable.");