[Pkg-javascript-commits] [uglifyjs] 109/491: display default values in `--help options` (#2018)
Jonas Smedegaard
dr at jones.dk
Wed Feb 14 19:51:26 UTC 2018
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/3.3.10-1
in repository uglifyjs.
commit e62b879b488f40acd4e7e95d70c53a91c45810ed
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date: Sun May 28 22:57:20 2017 +0800
display default values in `--help options` (#2018)
---
README.md | 5 +++--
bin/uglifyjs | 11 ++++++++---
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 985fe50..d7e65b2 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,7 @@ a double dash to prevent input files being used as option arguments:
```
-h, --help Print usage information.
+ `--help options` for details on available options.
-V, --version Print version number.
-p, --parse <options> Specify parser options:
`acorn` Use Acorn for parsing.
@@ -713,14 +714,14 @@ UglifyJS.minify(code, { mangle: { toplevel: true } }).code;
### Mangle properties options
-- `reserved` (default: `[]`) -- Do not mangle property names listed in the
+- `reserved` (default: `[]`) -- Do not mangle property names listed in the
`reserved` array.
- `regex` (default: `null`) -— Pass a RegExp literal to only mangle property
names matching the regular expression.
- `keep_quoted` (default: `false`) -— Only mangle unquoted property names.
- `debug` (default: `false`) -— Mangle names with the original name still present.
Pass an empty string `""` to enable, or a non-empty string to set the debug suffix.
-- `builtins` (default: `false`) -- Use `true` to allow the mangling of builtin
+- `builtins` (default: `false`) -- Use `true` to allow the mangling of builtin
DOM properties. Not recommended to override this setting.
## Output options
diff --git a/bin/uglifyjs b/bin/uglifyjs
index b9406e1..a2039f7 100755
--- a/bin/uglifyjs
+++ b/bin/uglifyjs
@@ -21,7 +21,7 @@ var options = {
compress: false,
mangle: false
};
-program.version(info.name + ' ' + info.version);
+program.version(info.name + " " + info.version);
program.parseArgv = program.parse;
program.parse = undefined;
if (process.argv.indexOf("ast") >= 0) program.helpInformation = UglifyJS.describe_ast;
@@ -30,8 +30,13 @@ else if (process.argv.indexOf("options") >= 0) program.helpInformation = functio
var options = UglifyJS.default_options();
for (var option in options) {
text.push("--" + (option == "output" ? "beautify" : option == "sourceMap" ? "source-map" : option) + " options:");
- Object.keys(options[option]).forEach(function(name) {
- text.push(" " + name);
+ var defs = options[option];
+ var padding = "";
+ Object.keys(defs).map(function(name) {
+ if (padding.length < name.length) padding = Array(name.length + 1).join(" ");
+ return [ name, JSON.stringify(defs[name]) ];
+ }).forEach(function(tokens) {
+ text.push(" " + tokens[0] + padding.slice(tokens[0].length - 2) + tokens[1]);
});
text.push("");
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git
More information about the Pkg-javascript-commits
mailing list