1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 20:53:52 +00:00

534 Commits

Author SHA1 Message Date
Philip Top
75b19db1d8
fix: some GCC warnings and update codecov (#813)
* add some warning for GCC output

* fix some warnings

* style: pre-commit.ci fixes

* update ubuntu image used for cmake tests so it doesn't auto transition to 22.04

* try a few more warning flags

* install the correct files

* style: pre-commit.ci fixes

* fix install files

* add a few more things to pre-commit

* try a fix for codacy

* another try at codecov

* more coverage tweaks

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-12-10 10:30:36 -05:00
Philip Top
71755e4f67
tweak the parsing of files for flags with disable_flag_override (#800)
* tweak the parsing of files for flags with disable_flag_override, basically allow true as a valid value to be interpreted as the default in that case

* style: pre-commit.ci fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-30 15:43:25 -08:00
Philip Top
ca9a128720
test for out of bounds long long (#807)
* test for out of bounds long long

* style: pre-commit.ci fixes

* change to use std types

* style: pre-commit.ci fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-30 15:41:34 -08:00
Ryan Sherlock
8f8344bff8
fix: make_description min option output (#808)
Include spacing between the number of minimum options required and the rest of the description.
2022-11-30 11:31:11 -08:00
pre-commit-ci[bot]
788c3f58cb
chore(deps): pre-commit.ci autoupdate (#799)
* chore(deps): pre-commit.ci autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.4.0)
- [github.com/pre-commit/mirrors-clang-format: v14.0.6 → v15.0.4](https://github.com/pre-commit/mirrors-clang-format/compare/v14.0.6...v15.0.4)
- [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.3 → v3.0.0-alpha.4](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0-alpha.3...v3.0.0-alpha.4)

* style: pre-commit.ci fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-30 09:01:30 -08:00
DarkWingMcQuack
b16c8c8ce4
Update TypeTools.hpp (#803)
* Update TypeTools.hpp

fix #802 by using checking `std::ceil(val) == std::floor(val)` instead of `val == static_cast<std::int64_t>(val)` to avoid warnings-

* style: pre-commit.ci fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-21 08:05:04 -08:00
Henry Schreiner
c2ea58c7f9
chore: prepare for 2.3.1 (#797)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-10-31 23:54:32 -04:00
polistern
e2270dd6f8
fix: fixed footer newline behavior (#796)
* fix: show newline before footer only if footer is set and not empty

* chore: tests corrected for new help message formatting.
2022-10-28 21:15:18 -04:00
Philip Top
25274e2c7b
fix: missing function definition (#793)
* the get_option_group definition was missing from the splitting of the calls.

* style: pre-commit.ci fixes

* the get_option_group definition was missing from the splitting of the calls.

* style: pre-commit.ci fixes

* add test for missing function

* style: pre-commit.ci fixes

* add test for get_option_group

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-28 09:57:54 -04:00
Philip Top
4dbe4b4ec4
tests: add a few more coverage tests (#794)
* add a few more coverage tests

* style: pre-commit.ci fixes

* try to fix pre-commit issues

* update mdlint style as a test

* style: pre-commit.ci fixes

* fix test

* switch test to not generate warning

* add a few more tests

* tweak the conanfile and appveyor to debug issue

* update tests

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-28 00:23:22 -04:00
Marcin Ropa
9a6c6f6b50
fix: static analysis problems (#785)
* fix: static analysis problems

* fix to warrnings reported by Klocwork in CLI11 v2.2.0

* style: pre-commit.ci fixes

* Update include/CLI/FormatterFwd.hpp

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>

* Update include/CLI/FormatterFwd.hpp

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2022-10-08 16:16:46 -04:00
Henry Schreiner
a66ae41457
chore: bump version (#782)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-10-06 00:09:41 -04:00
Philip Top
fd30b5989f
fix: improve some confusing error situations with config files (#781)
* add some more tests for coverage and fix some confusing error situations with config files.

* style: pre-commit.ci fixes

* fix warning

* ci: fix coverage

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2022-09-29 11:48:03 -04:00
Philip Top
dcbcb4721d
fix: negated flag config files (#775)
* add some coverage tests, and fix the issue with negated flags and config files

* style: pre-commit.ci fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-09-14 10:45:22 -04:00
Henry Schreiner
1a26afab04
fixi: include windows 2022 (#748)
* ci: include windows 2022

* fix visual studio 2022 issue with std::array and type detection

* style: pre-commit.ci fixes

* warning fixes

Co-authored-by: Philip Top <top1@llnl.gov>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Philip Top <phlptp@gmail.com>
2022-09-05 23:51:15 -04:00
pre-commit-ci[bot]
d3a8dfb065 style: pre-commit.ci fixes 2022-08-23 11:42:02 -04:00
Daniel Herrera Castro
7a7e0822dd [precompile] Split Validators.hpp 2022-08-23 11:42:02 -04:00
Daniel Herrera Castro
4048596250 [precompile] Split StringTools.hpp 2022-08-23 11:42:02 -04:00
Daniel Herrera Castro
d1f0f483da [precompile] Split Split.hpp 2022-08-23 11:42:02 -04:00
Daniel Herrera Castro
c24bf75413 [precompile] Split Formatter.hpp 2022-08-23 11:42:02 -04:00
Daniel Herrera Castro
003e82579e [precompile] Split Config.hpp 2022-08-23 11:42:02 -04:00
Daniel Herrera Castro
3e5173d468 [precompile] Split Option.hpp 2022-08-23 11:42:02 -04:00
Daniel Herrera Castro
b56ae237e5 [precompiled] Initial proof-of-concept with App.cpp
- Add C11_COMPILE cmake option that creates a static lib instead of header-only
- Add C11_INLINE macro that depends on C11_COMPILE
- Split App.hpp into App.hpp and impl/App_inl.hpp
- Add App.cpp that compiles App_inl.hpp into an object file
- CMake modifications to handle impl headers differently for sinlge-header, headers-only, and compiled versions
2022-08-23 11:42:02 -04:00
Matt McCormick
c57000e582
fix: add missing Macros.hpp include to Error.hpp (#755)
* Add missing Macros.hpp include to Error.hpp

To address:

```
In file included from /ITKWebAssemblyInterface/include/itkPipeline.h:21:
In file included from /ITKWebAssemblyInterface-build/_deps/cli11-src/include/CLI/App.hpp:25:
In file included from /ITKWebAssemblyInterface-build/_deps/cli11-src/include/CLI/ConfigFwd.hpp:17:
/ITKWebAssemblyInterface-build/_deps/cli11-src/include/CLI/Error.hpp:75:5: error: unknown type name 'CLI11_NODISCARD'
    CLI11_NODISCARD int get_exit_code() const { return actual_exit_code; }
    ^
```

* style: pre-commit.ci fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-05 00:10:54 -04:00
Henry Schreiner
c781998273
chore: clang tidy updates (#742)
* chore: update clang-tidy

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* refactor: address clang-tidy

* fix: C++11 support

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* chore: two more clang-tidy fixes

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: get_inject_separator should be bool

* refactor: addressing review feedback

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Philip Top <phlptp@gmail.com>

* Apply suggestions from code review

* Update include/CLI/Config.hpp

* Update include/CLI/Config.hpp

* Update include/CLI/Config.hpp

* Update include/CLI/Config.hpp

Co-authored-by: Philip Top <phlptp@gmail.com>
2022-06-26 14:53:01 -04:00
Philip Top
443c1a946d
fix: wrap min and max for MSVC (#741)
* wrap min and max in parenthesis for Visual studio 2017 and earlier compatibility

* try pre-commit to detect min/max issues

* actually fix the identified issues from the new check

* more min/max fixes
2022-06-09 14:07:59 -04:00
Philip Top
020a21afc6
Fix an issue where an error was generated if just a file name was supplied to the split_program_name parsing (#740) 2022-06-05 19:36:30 -07:00
PeteAudinate
c692be41cf
fix: rename variable to avoid clash with optarg (#734)
https://linux.die.net/man/3/optarg
2022-05-24 15:23:09 -04:00
Philip Top
de215ef978
Incorrect subcommand callback trigger (#733)
* fix the issue where subcommand callbacks would be triggered multiple times if specified as configurable.

* style: pre-commit.ci fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-05-24 15:19:41 -04:00
shameekganguly
efbfd460a7
Include <functional> in FormatterFwd (#727)
Without this header, the project might not compile is some environments.

Signed-off-by: Shameek Ganguly <shameekarcanesphinx@gmail.com>
2022-05-20 14:52:42 -07:00
pre-commit-ci[bot]
607ab9429f
chore(deps): pre-commit.ci autoupdate (#725)
* chore(deps): pre-commit.ci autoupdate

updates:
- [github.com/pre-commit/mirrors-clang-format: v13.0.1 → v14.0.1](https://github.com/pre-commit/mirrors-clang-format/compare/v13.0.1...v14.0.1)

* style: pre-commit.ci fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-18 18:12:20 -04:00
Philip Top
b9be5b9444
docs: update readme and changelog and version number (#718)
* Update readme and changelog and version number

* style: pre-commit.ci fixes

* fix missing references

* style: pre-commit.ci fixes

* merge in changes from non existent 2.1.3 patch release

* Update CHANGELOG.md

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: Henry Schreiner <henry.fredrick.schreiner@cern.ch>
2022-03-26 23:35:05 -04:00
Philip Top
4cae08686d
docs: update copyright dates to 2022 (#717) 2022-03-26 21:54:49 -04:00
Philip Top
f7d26f26b2
feat: counting flags (#709)
* add a counting flag to address and issue with optional<bool>  and make the flags more consistent

* move the add_flag to a single operation and add a Sum multi option policy

* style: pre-commit.ci fixes

* remove sum_flag_vector overloads

* style: pre-commit.ci fixes

* add limits include

* style: pre-commit.ci fixes

* fix some other warnings

* update docs describing the multi_option_policy

* Apply suggestions from code review

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2022-03-21 18:56:35 -04:00
Philip Top
95e7f81d1d
fix: trigger on parse positional (#713)
* allow the trigger on parse modifier to work with positional arguments as well

* style: pre-commit.ci fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-03-21 17:51:08 -04:00
RangeMachine
59159387e9
fix: MSVC C++20 macro typo (#706) 2022-02-23 11:51:34 -05:00
Philip Top
e29cb3f1b4
feat: support empty vector in TOML (#660)
* add tests which suppose to pass

* Update ConfigFileTest.cpp

* Update ConfigFileTest.cpp

* style: pre-commit.ci fixes

* add the possibility for an empty vector result if allowed.

* style: pre-commit.ci fixes

* add empty vector command line tests

* update book and readme

* add no default test

Co-authored-by: puchneiner <90352207+puchneiner@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-02-09 13:12:55 -05:00
Philip Top
256559401e
Add a transform/validator that checks for files on a default path. (#698)
* Add a transform/validator that checks for files on a default path.

* update docs and add tests and capability of chaining the FileOnDefaultPath transform

* style: pre-commit.ci fixes

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>

* add test of "or" operation and few doc additions

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2022-01-31 15:07:54 -08:00
Philip Top
a5498bed17
feat: add an option to validate optional arguments like in a vector. (#668)
* add an option to validate optional arguments like in a vector.  This can resolve some issues with separating positionals from vector arguments

* style: pre-commit.ci fixes

* add some updates to the book

* style: pre-commit.ci fixes

* fix some precommit issues

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-28 11:15:55 -05:00
Philip Top
5ba63620dc
fix: update the range error output (#690)
* update the range error output to be able to be used by more types, and better printouts in some situations.

* style: pre-commit.ci fixes

* add test

* style: pre-commit.ci fixes

* fix the test

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-05 15:36:15 -05:00
Henry Schreiner
f897aad11a
fix: avoid a warning about useless move (#678)
* fix: avoid a warning about useless move

* style: pre-commit.ci fixes

* Update include/CLI/App.hpp

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-02 13:20:13 -05:00
Matt McCormick
612f4584b6
fix: add WASI build support (#679)
Addresses:

  wasm-ld: error:
  CMakeFiles/WebAssemblyInterfaceHeaderTest1.dir/test/WebAssemblyInterfaceHeaderTest1.cxx.o:
  undefined symbol:
  std::__2::__fs::filesystem::__status(std::__2::__fs::filesystem::path
  const&, std::__2::error_code*)

  /usr/wasi-sdk-14.0/share/wasi-sysroot/include/c++/v1/filesystem:256:3:
  error: "The Filesystem library is not supported by this configuration
  of libc++"
  # error "The Filesystem library is not supported by this configuration
  of libc++"
2021-12-02 13:19:48 -05:00
Philip Top
17e7d60c18
fix: several small fixes and added tests (#666)
* add a few tests related to github issues

* change how the default is displayed in the help message prev was =XXXX,  this was confusing in some cases particularly with flags or with multiple option names.    Now is [default=XXXX]  which makes it clearer what the value represents.

* Try to fix RTTI issue

* style: pre-commit.ci fixes

* Fix subcommand callbacks being called multiple times if in an option group

* style: pre-commit.ci fixes

* remove extra group call

* change [default=XXXXD] to just [XXXXX] for the default specification

* update changelog

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-21 23:44:04 -05:00
Philip Top
eba619fc68
fix: a potential stack overflow error (#665)
* Fix a potential stack overflow error if nameless subcommands have fallthough

* style: pre-commit.ci fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-18 00:44:10 -05:00
Philip Top
815553211b
fix and test some reported issues (#661) 2021-11-01 23:12:55 -04:00
Philip Top
728ac3a877
run some tests and fixes for C++20 (#663) 2021-11-01 23:10:44 -04:00
Henry Schreiner
70f8072f9d
chore: bump version (#658)
* chore: update changelog for 2.1.2

* chore: bump version
2021-10-18 10:14:21 -04:00
Henry Schreiner
98d200bd8b chore: move to main 2021-10-17 22:39:05 -04:00
Henry Schreiner
3b95b94406
chore: use PyPI clang-format package, pinned (#647)
* chore: use PyPI clang-format package, pinned

* style: pre-commit.ci fixes

* ci: drop unneeded job

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-09-29 06:15:48 -04:00
Henry Schreiner
b440890eaf
docs: changelog update (#643)
* docs: changelog update

* chore: bump version(s)

* style: pre-commit.ci fixes

* docs: spelling fix

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-09-24 20:37:01 -04:00