-v, --version, -h, or --help take priority
Created by: VictorSCushman
Previously a command such as:
ldpl -h foo
or
ldpl -v foo
would ignore the help/version argument and attempt to run the file foo.
This commit changes this behavior such that any time -v, --version, -h, or --help is supplied the version/help info will be displayed.
Example
# CURRENT MASTER
~/code/ldpl/src[master !?]$ ./ldpl-master -h
Usage: ldpl [options] file [arguments]
Options:
-h --help Display this information
-r Display generated C++ code
-i=<file> Include file in current compilation
-v --version Display LDPL version information
~/code/ldpl/src[master !?]$ ./ldpl-master --help
Usage: ldpl [options] file [arguments]
Options:
-h --help Display this information
-r Display generated C++ code
-i=<file> Include file in current compilation
-v --version Display LDPL version information
~/code/ldpl/src[master !?]$ ./ldpl-master -h foo
LDPL Error: The file 'foo' couldn't be opened.
~/code/ldpl/src[master !?]$ ./ldpl-master --help foo
LDPL Error: The file 'foo' couldn't be opened.
# MY CHANGES
~/code/ldpl/src[master !?]$ ./ldpl -h
Usage: ldpl [options] file [arguments]
Options:
-h --help Display this information
-r Display generated C++ code
-i=<file> Include file in current compilation
-v --version Display LDPL version information
~/code/ldpl/src[master !?]$ ./ldpl --help
Usage: ldpl [options] file [arguments]
Options:
-h --help Display this information
-r Display generated C++ code
-i=<file> Include file in current compilation
-v --version Display LDPL version information
~/code/ldpl/src[master !?]$ ./ldpl -h foo
Usage: ldpl [options] file [arguments]
Options:
-h --help Display this information
-r Display generated C++ code
-i=<file> Include file in current compilation
-v --version Display LDPL version information
~/code/ldpl/src[master !?]$ ./ldpl --help foo
Usage: ldpl [options] file [arguments]
Options:
-h --help Display this information
-r Display generated C++ code
-i=<file> Include file in current compilation
-v --version Display LDPL version information