discoteq/flock

-V and --version flags are not recognised

marcomorain opened this issue · 2 comments

The usage shown with --help suggests that --version or -V will "output version information and exit". This is not the case:

$ ./flock --help
Usage:
 flock [-sxun][-w #] fd#
 flock [-sxon][-w #] file [-c] command...
 flock [-sxon][-w #] directory [-c] command...

Options:
 -s  --shared     Get a shared lock
 -x  --exclusive  Get an exclusive lock
 -u  --unlock     Remove a lock
 -n  --nonblock   Fail rather than wait
 -w  --timeout    Wait for a limited amount of time
 -o  --close      Close file descriptor before running command
 -c  --command    Run a single command string through the shell
 -h  --help       Display this text
 -V  --version    Display version
$ ./flock --version
flock: unrecognized option `--version'
<prints usage info>
$ ./flock -V
flock: invalid option -- V
<prints usage info>

🤦‍♂️ I'm so sorry! Would you like to take a swing at implementing this, or wait for me to have a little free time? Should be a simple addition to around here: https://github.com/discoteq/flock/blob/master/src/flock.c#L170, and check your generated config.h for the appropriate. way to access the version number

Thanks @josephholsten - addressed in #12