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.
This commit is contained in:
tomByrer 2014-04-03 18:08:07 -06:00
parent 14f290f8ab
commit 9819e61e65

View File

@ -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]