Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to limit version argument to --version #103

Merged
merged 1 commit into from
Jun 5, 2021
Merged

Allow user to limit version argument to --version #103

merged 1 commit into from
Jun 5, 2021

Conversation

kfsone
Copy link
Contributor

@kfsone kfsone commented Jun 5, 2021

Per #102 -- introduces a compiler directive to allow "--version" to be restricted to the long-form only, and a CMakeLists.txt option for controlling it.

Example with it disabled:

set (ARGPARSE_LONG_VERSION_ARG_ONLY ON)
add_subdirectory(argparse)

produces:

> .\build\cparse\cparse.exe --help
Usage: cparse [options]

Optional arguments:
-h --help       shows help message and exits
--version       prints version information and exits
-v --verbose    Increase output verbosity
-q --quiet      Decrease output verbosity
-G --gui        Enable GUI [default: false]

where as without this option on:

> .\build\cparse\cparse.exe --help
Usage: cparse [options]

Optional arguments:
-h --help       shows help message and exits
-v --version     prints version information and exits
-v --verbose    Increase output verbosity
-q --quiet      Decrease output verbosity
-G --gui        Enable GUI [default: false]

@p-ranav p-ranav merged commit 64dd67c into p-ranav:master Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants