From 3bd42aafb5e8cd104bd576e87ba3448b0c4a6554 Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Fri, 5 Dec 2008 09:26:20 +0200 Subject: [PATCH] Fix ':set' to only show the nondefault entries --- common/content/options.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/common/content/options.js b/common/content/options.js index 86eaa25a..8984f48e 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -563,19 +563,29 @@ 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."); else if (name == "all")