Add --help and --version

--help is alias of -h
--version is alias of -V
This commit is contained in:
Takayuki MATSUOKA 2016-02-22 22:12:43 +09:00
parent 7d17c88dec
commit 45c322c8ac
2 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,7 @@ OPTIONS
* `-c`, `--check`:
Read xxHash sums from the <FILE>s and check them
* `-h`:
* `-h`, `--help`:
Display help and exit
* `-H`<HASHTYPE>:
@ -44,7 +44,7 @@ OPTIONS
Set output hexadecimal checksum value as little endian convention.
By default, value is displayed as big endian
* `-V`:
* `-V`, `--version`:
Display xxhsum version
**The following four options are useful only when verifying checksums (`-c`)**

View File

@ -1297,6 +1297,8 @@ int main(int argc, const char** argv)
if (!strcmp(argument, "--status")) { statusOnly = 1; continue; }
if (!strcmp(argument, "--quiet")) { quiet = 1; continue; }
if (!strcmp(argument, "--warn")) { warn = 1; continue; }
if (!strcmp(argument, "--help")) { return usage_advanced(exename); }
if (!strcmp(argument, "--version")) { DISPLAY(WELCOME_MESSAGE); return 0; }
if (*argument!='-')
{