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

1338 Commits

Author SHA1 Message Date
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
pre-commit-ci[bot]
10f3ab9025
chore(deps): pre-commit.ci autoupdate (#703)
* chore(deps): pre-commit.ci autoupdate

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

* Update .pre-commit-config.yaml

* Update .pre-commit-config.yaml

* Update .pre-commit-config.yaml

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <henry.fredrick.schreiner@cern.ch>
2022-02-23 15:30:43 -05: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
Eli Schwartz
e8265f9102
meson: add support for testsuite (#701)
* meson: add support for testsuite

* meson: fix deprecation warning for run_command with unchecked return code

This would implicitly default to false, so if something bizarre happened
and the command errored out, meson would consider that fine. Now meson
emits a warning about this deprecated legacy behavior, suggests that it
will eventually change, and, most importantly, prevents a warning-free
build.

Suppress the warning by manually specifying the sensible behavior, which
is to fail on errors.

* meson: download catch2 on demand if a system version is unavailable

Produced by running `meson wrap install catch2` and checking the results
into git.

No modifications to the build files are expected; this makes use of
https://mesonbuild.com/Wrap-dependency-system-manual.html#provide-section

* style: pre-commit.ci fixes

* ci: add meson build to the CI

* ci: meson doesn't depend on ninja or or have a ninja extra

* ci: minor cleanup to Meson job

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-02-09 00:26:04 -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
pre-commit-ci[bot]
cd10be7fff
chore(deps): pre-commit.ci autoupdate (#700)
updates:
- [github.com/psf/black: 21.12b0 → 22.1.0](https://github.com/psf/black/compare/21.12b0...22.1.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-31 14:40:32 -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
ba5ca8c4fc
remove the symbolic link in the meson test (#697)
* remove the symbolic link in the meson test

* update python version in meson test

* remove directory from git and add directory creation into azure scripts

* remove the generated symlink

* Update azure-pipelines.yml

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

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2022-01-28 06:49:20 -08:00
dependabot[bot]
291af01f28
chore: bump jwlawson/actions-setup-cmake from 1.11 to 1.12 (#695)
Bumps [jwlawson/actions-setup-cmake](https://github.com/jwlawson/actions-setup-cmake) from 1.11 to 1.12.
- [Release notes](https://github.com/jwlawson/actions-setup-cmake/releases)
- [Commits](https://github.com/jwlawson/actions-setup-cmake/compare/v1.11...v1.12)

---
updated-dependencies:
- dependency-name: jwlawson/actions-setup-cmake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 06:12:29 -08: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
pre-commit-ci[bot]
9ec0ba78f6
chore(deps): pre-commit.ci autoupdate (#693) 2021-12-27 16:44:04 -05:00
Andreas Deininger
6b95ee8ab5
Fix logic in example 'option_groups', documentation: fix escaped colon glyph (#692)
* Documentation: fixing escaped colon sign

* Example option_groups:

* fix output logic
* add whitespace between format_type and string "format"
2021-12-24 12:29:46 -08:00
Andreas Deininger
b65367a15a
Documentation: add link to multifile subcommand example in repo (#691) 2021-12-15 10:44:08 -08:00
pre-commit-ci[bot]
3c7257d2ae
chore(deps): pre-commit.ci autoupdate (#681)
updates:
- [github.com/psf/black: 21.11b1 → 21.12b0](https://github.com/psf/black/compare/21.11b1...21.12b0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-10 17:24:38 -08: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
pre-commit-ci[bot]
52ee425d95
chore(deps): pre-commit.ci autoupdate (#671)
updates:
- [github.com/psf/black: 21.10b0 → 21.11b1](https://github.com/psf/black/compare/21.10b0...21.11b1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-11-26 23:13:40 -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
pre-commit-ci[bot]
16919dd1b2
chore(deps): pre-commit.ci autoupdate (#664) 2021-11-01 17:38:38 -04:00
Henry Schreiner
70f8072f9d
chore: bump version (#658)
* chore: update changelog for 2.1.2

* chore: bump version
v2.1.2
2021-10-18 10:14:21 -04:00
Henry Schreiner
4ebb25d10f
docs: fix Codecov badge 2021-10-17 22:44:48 -04:00
Henry Schreiner
b89dcd8716 docs: restore appveyor, remove travis file 2021-10-17 22:39:05 -04:00
Henry Schreiner
98d200bd8b chore: move to main 2021-10-17 22:39:05 -04:00
Henry Schreiner
a393e353ef
fix(build): simplify runs from master projects, require C++11 minimally if possible (#656) 2021-10-16 12:31:24 -04:00
Henry Schreiner
229844f4f8
docs: update CHANGELOG 2021-10-13 15:35:59 -04:00
Henry Schreiner
de28d11f7c
tests: support external Catch2 (#653) 2021-10-13 11:45:44 -04:00
Henry Schreiner
a55a7fc07a
chore: use official pre-commit mirror (#654) 2021-10-13 10:21:12 -04:00
pre-commit-ci[bot]
3ce61a1692
chore(deps): pre-commit.ci autoupdate (#650)
updates:
- [github.com/ssciwr/clang-format-hook: v12.0.1 → v13.0.0](https://github.com/ssciwr/clang-format-hook/compare/v12.0.1...v13.0.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-10-04 23:36:41 -04:00
Henry Schreiner
b59e37fbb9
docs: link to 2.1 for try online 2021-09-29 09:12:20 -04:00
Henry Schreiner
5ce8958c7e
docs: release action fixed, no reminder needed now v2.1.1 2021-09-29 07:24:48 -04:00
Henry Schreiner
f19629f84c
docs: add recent changes 2021-09-29 07:21:42 -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
Philip Top
81b092e085
tests: fix the compile issues with the boost<optional> tests and catch (#646)
* Fix the compile issues with the boost<optional> tests and catch

* tests: add Boost test (back)

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2021-09-28 09:33:28 -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
Philip Top
4101964033
fixes potential conflict with some windows macro redefinitions of min and max in the validators. (#642) 2021-09-23 19:55:33 -04:00
dependabot[bot]
c1e2ab4465
chore: bump jwlawson/actions-setup-cmake from 1.10 to 1.11 (#641)
Bumps [jwlawson/actions-setup-cmake](https://github.com/jwlawson/actions-setup-cmake) from 1.10 to 1.11.
- [Release notes](https://github.com/jwlawson/actions-setup-cmake/releases)
- [Commits](https://github.com/jwlawson/actions-setup-cmake/compare/v1.10...v1.11)

---
updated-dependencies:
- dependency-name: jwlawson/actions-setup-cmake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-23 08:04:30 -04:00
pre-commit-ci[bot]
672caf16bf
chore(deps): pre-commit.ci autoupdate (#639)
updates:
- [github.com/psf/black: 21.8b0 → 21.9b0](https://github.com/psf/black/compare/21.8b0...21.9b0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-09-20 22:33:44 -04:00
Henry Schreiner
ac29910a69
docs: prepare for 2.1 (#638)
* docs: changelog update

* docs: prepare for 2.1

* Apply suggestions from code review

Co-authored-by: Philip Top <top1@llnl.gov>

Co-authored-by: Philip Top <top1@llnl.gov>
v2.1.0
2021-09-20 15:50:58 -04:00
Philip Top
6c49c299b9
feat: add a more clear force callback (#631)
* Add some missing modifiers on the options to the docs and clarify some of them.

* style: pre-commit.ci fixes

* add a more clear force callback and callback on parse modifier for options.

* update the book with new modifiers

* update documentation and add tests

* style: pre-commit.ci fixes

* more updates to the readme

* update formatting

* rework the trigger_on_parse to better support more complex option types

* fix formatting errors

* Update include/CLI/Option.hpp

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>
2021-09-20 10:23:39 -04:00
pre-commit-ci[bot]
bd3c9cb562
chore(deps): pre-commit.ci autoupdate (#637)
updates:
- [github.com/psf/black: 21.7b0 → 21.8b0](https://github.com/psf/black/compare/21.7b0...21.8b0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-09-15 18:33:10 -04:00
Philip Top
8b785a6c7d
feat: add some capabilities to the config parser and a stream parser (#630)
* add some capabilities to the config parser and a stream parser

* style: pre-commit.ci fixes

* add additional tests for the config parser

* additional tests of config sections and indexing

* style: pre-commit.ci fixes

* add initialization for member variables

* warning and error fixes

* add test for `parse_from_stream`

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-08-22 23:53:06 -04:00
Philip Top
19047d8d68
feat: relaxed option naming (#627)
* add a test for std::map

* add some test of the relaxed naming and other checks

* add validator for aliases, group names and option groups

* add extra tests and update readme

* style: pre-commit.ci fixes

* update the book chapters

* fix codacy issue

* 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>
2021-08-22 23:52:00 -04:00
Jose Luis Rivero
d17016e76c
fix(build): relocate cmake and pkgconfig files to an arch-independent path (#635)
* Relocate cmake and pkgconfig files to an arch-independent path

Use CMAKE_INSTALL_DATADIR instead of CMAKE_INSTALL_LIBDIR for
installing the pkgconfig and cmake files.

Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>

* style: pre-commit.ci fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-08-22 23:51:30 -04:00
dependabot[bot]
2d2372d596
chore: bump jwlawson/actions-setup-cmake from 1.9 to 1.10 (#634)
Bumps [jwlawson/actions-setup-cmake](https://github.com/jwlawson/actions-setup-cmake) from 1.9 to 1.10.
- [Release notes](https://github.com/jwlawson/actions-setup-cmake/releases)
- [Commits](https://github.com/jwlawson/actions-setup-cmake/compare/v1.9...v1.10)

---
updated-dependencies:
- dependency-name: jwlawson/actions-setup-cmake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-22 23:49:21 -04:00
Benjamin Beichler
2f0435f390
only add CONFIGURE_DEPENDS if main project (#633)
- reglobbing of files is confusing, if CLI11 is used as library, as typically the files won't change
2021-08-10 21:55:10 -04:00