From 9819e61e658ff4fdc0650bce86507ba4f6e1eee6 Mon Sep 17 00:00:00 2001 From: tomByrer Date: Thu, 3 Apr 2014 18:08:07 -0600 Subject: [PATCH] fix comments: true doc, add "@license" tip The doc was misleading, & [I'm not the only one](https://github.com/mishoo/UglifyJS2/issues/82) who believes so. --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 27d06cd6..00ed647b 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,14 @@ The available options are: -d, --define Global definitions [string] -e, --enclose Embed everything in a big function, with a configurable parameter/argument list. [string] - --comments Preserve copyright comments in the output. By default this - works like Google Closure, keeping JSDoc-style comments - that contain "@license" or "@preserve". You can optionally + --comments Preserve comments in the output. You can optionally pass one of the following arguments to this flag: - - "all" to keep all comments + - "all" or "true" to keep all comments - a valid JS regexp (needs to start with a slash) to keep only comments that match. + For example, to keep JSDoc-style comments that contain + "@license" or "@preserve", use this option: + `comments: /@license|@preserve/` Note that currently not *all* comments can be kept when compression is on, because of dead code removal or cascading statements into sequences. [string]