Only those places in the README where an error is explicitly found in the
main function have been updated. Other uses of exit are left untouched as
there is not enough context to know if return will work in that location.
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
Allows users to opt-out of std::exit call in default arguments without
needing to replace with new --help and --version arguments.
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
The option() command expects a help string between the variable and the
initial value.
Closes#241
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
This attempts to fix Issue #225-1 by reverting the change that turned a
std::bad_any_cast exception into a nullptr.
Reverts commit 357068156e.
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
The intent of ": 1" is to use individual bits to store the bool state of
these class values. Because true != 0, this worked. But it was likely to
bite someone sometime. (My bad: 0fe17e22f6.)
This commit also adds m_accepts_optional_like_value to the bit field and
sets the default false value in the constructor.
Because we cannot set a default value during declaration (until C++20).
make sure future coders know to set the preferred default in the
constructor.
Closes#213
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
This replaces the verbiage copied from the Python argparse documentation
and makes the code sample more concrete. This illustrates how to avoid the
multiple help output problem reported in #165.
Closes#165
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
This allows updating attached object properties without holding external
references to the various Argument and ArgumentParser objects.
Closes#227
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
The previous regex would also analyze doctest.hpp. We don't need to check
a vendored library.
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
Added ARGPARSE_INSTALL
This allows a separate project using argparse through CMake FetchContent_Declare(...) to install the project without having to also install argparse.
Resolves the following error during stage one of clang-tidy-pr-comments:
"error: 'argparse/argparse.hpp' file not found [clang-diagnostic-error]"
Closes#219
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
This allows checking whether user input was processed into the parser
or any attached subparsers.
Closes#212
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
FetchContent_MakeAvailable was added in CMake v3.14. Also includes
end-of-line whitespace clean-ups.
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
Resolves the following build error:
CMake Error at CMakeLists.txt:26 (ADD_EXECUTABLE):
Target "ARGPARSE_SAMPLE_custom_assignment_characters" links to target
"argparse::argparse" but the target was not found. Perhaps a
find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?
Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>