This has been bounced around for a couple years now
#474 and a few others have expressed desire to work with non-standard
option names. We have been somewhat resistant to that but I think it can
be done now. This PR adds a modifier `allow_non_standard_option_names()`
It is purposely long, it is purposely off by default. But what it does
is allow option names with a single `-` to act like a short option name.
With this modifier enabled no single letter short option names are
allowed to start with the same letter as a non-standard names. For
example `-s` and `-single` would not be allowed.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Added include-what-you-use pragmas to:
* let IWYU point users to the main include file CLI/CLI.hpp
* tell IWYU that CLI/CLI.hpp is the main exporting header.
This should fix#816
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Philip Top <phlptp@gmail.com>
* Fix internal header include paths.
The extra leading "CLI/" part of include directives prevents the inclusion
of CLI.hpp from a relative directory without an extra -I or /I compiler
directive.
* Fix single header generation script.
Files included with "" should be relative to the header file location first.
* Add whitespace/comments check
* Adapt spacing in clang-format
* Fix cpplint whitespace/comments issues
* Grammar
* Do not use clang-format for comment spacing
* Fix with clang-format pre-commit hook
fix incorrect parenthesis
update some clang-tidy fixes mainly else after return but a few conversions from into to bool
add extra newline before footer
add an extra field to the extra Error
add a footer callback for help operations
add some comments in readME about performance
move operator[] to return const Option *
Apply suggestions from code review
Co-Authored-By: phlptp <top1@llnl.gov>
update readme and add some IniTests and fix a bug from the tests
add_flag_callback
add a few tests to capture the different paths
fix incorrectly updated CMAKE file, and add some subcommand test for option finding
add disable_flag_override and work out some kinks in the find option functions
add some more tests and fix a few bugs in as<> function for options
Allow general flag types and default values, add shortcut notation for retrieving values
Updates to the readme
update the readme with some documentation
add a few more tests to complete code coverage
update with count strings in flags instead an array of strings for each count
add the '!' shortcut notation. add some checks on the help output
allow the false flag syntax to support --option{false}
add a bool lexical cast to make everything consistent when converting to a bool. Moved a few functions around
make the command line behave like the INI file wrt flags, flag options are allowed to process the value so `--flag=false` actually does the expected thing.
Add functionality similar to click style argument that allow specifying a false flag that when used generates a false result on the flag.
* add some fields and functions for windows like options
add test cases for windows options and refactor for additional string functions
* try to fix code coverage to 100% again. add some additional documentation and a few additional test cases to verify documentation
* remove some extra brackets