mathiasbynens / he

A robust HTML entity encoder/decoder written in JavaScript.
https://mths.be/he
MIT License
3.43k stars 255 forks source link

calling with `-v` explicitly should return success #28

Closed bahamas10 closed 8 years ago

bahamas10 commented 9 years ago
$ he -v; echo $?
v0.5.0
1

is unexpected

mathiasbynens commented 9 years ago

The current behavior matches the man page: https://github.com/mathiasbynens/he/blob/089b8afba8b3efe865e1c5bc38ed063103ff8a05/man/he.1#L49-L62 If you want to change it, the man page should be updated as well.

bahamas10 commented 9 years ago

@mathiasbynens this has been updated. the documentation now states he will exit with code 0 if it did what it was told to do successfully, which includes encoding/decoding data, or printing the version/usage string.

calling he with -v, --version, -h or --help will exit with 0, whereas calling he without arguments will exit with 1 (while still printing the usage message).

coveralls commented 9 years ago

Coverage Status

Coverage remained the same at 96.64% when pulling e848a4188a7e617d428772d0defd68b35de2266e on bahamas10:patch-1 into 089b8afba8b3efe865e1c5bc38ed063103ff8a05 on mathiasbynens:master.

mathiasbynens commented 8 years ago

Thanks!