Adds @mochaaP as a contributor for platform.
This was requested by phlptp [in this
comment](https://github.com/CLIUtils/CLI11/pull/1280#issuecomment-3761350721)
[skip ci]
---------
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
- Bump meson version to 1.3
- Bump default cpp_std (required by Catch2 3.x, still possible for c++11
fallback)
- Move option `single-file-header` and `precompiled` to `mode`
- Make pkgconfig optional
- Refactor tests, fix a bizzare situation where filename contains quote
or escape characters
In C++26, std::complex gained a tuple interface (P2819R2), causing
template specialization ambiguity in type_count and type_count_min.
This change explicitly excludes is_complex from tuple-like template
specializations, ensuring complex types are handled only by their
dedicated specializations.
Fixes#1098
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Allow more control over how extras are interpreted. Specifically
allowing some assumptions to be made about arguments to unrecognized
options. With `CLI::ExtrasMode::AssumeMultipleArguments` all positional
arguments following an unrecognized option will be considered extra as
well even if there are open positional arguments. With
`CLI::ExtrasMode::AssumeSingleArgument` a positional argument following
an unrecognized option will also be considered unrecognized and go into
the `remaining()` bin.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Adds @jaefunk as a contributor for doc.
This was requested by phlptp [in this
comment](https://github.com/CLIUtils/CLI11/pull/1275#issuecomment-3694056410)
[skip ci]
---------
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Adds @The0Dev as a contributor for code.
This was requested by phlptp [in this
comment](https://github.com/CLIUtils/CLI11/pull/1273#issuecomment-3692934734)
[skip ci]
---------
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
adding a PrefixCommandMode option to the prefix_command to allow
specification of a separator and catch other errors
Addresses #1264
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
fix an issue where an enumeration with a stream output method would
generate strings that could not be converted back to the original
enumeration value.
Fixes Issue #1258
recent changes fixed a few issues with the default_val method. The
method used the to_string, which in cases where a user supplied a
streaming operation to enumerations they could not be converted back to
the enumeration properly resulting in some errors and confusing help
output.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
include impl headers with precompiled option.
This may be necessary for some package installs if they wish to include
the precompiled static library alongside the header only install.
inspired by #1198
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Update documentation related to formatters and some other recent
updates.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Add some controls to manipulate option string formatting, including
disabling the default values, disabling default flag values, disabling
type names.
Fixes#857
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Based on #1242, I don't think this is required but it does remove that
issue and checking on compiler explore it does simplify the generated
code.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Adds @LunarWatcher as a contributor for doc.
This was requested by phlptp [in this
comment](https://github.com/CLIUtils/CLI11/pull/1239#issuecomment-3434894391)
[skip ci]
---------
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Adds @TheodorNEngoy as a contributor for infra.
This was requested by phlptp [in this
comment](https://github.com/CLIUtils/CLI11/pull/1225#issuecomment-3418608931)
[skip ci]
---------
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Fix the help spacing and double printing of footers in certain
circumstances
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Extension allowing all possible priority combinations.
Add a field callback_priority to OptionBase.
---------
Co-authored-by: Philip Top <phlptp@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Adds @romanholidaypancakes as a contributor for code.
This was requested by phlptp [in this
comment](https://github.com/CLIUtils/CLI11/pull/1206#issuecomment-3292000117)
[skip ci]
---------
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Rework some of the validator locations, add documentation, and fix some
lingering issues with validators.
The extra will will enable additions of some new validators and reduce
compile times for those that are not needed.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
fix an issue with duplicate footers being printed with help_all
Fixes#1183
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
generating a seg fault if no default and no config file provided.
Fixes#1197
This was likely introduced by the combination of fixes for some issues
with the config parsing and some updates to the as<T> method a while
back. This edge case on the handling of the config pointer with as was
not overlooked in the earlier testing.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
The default formatter has hardcoded ratio at which the long options are
aligned. It's currently 1/3 of the column, which makes the default look
awkward:
```
-h, --help Print
--option Something
```
A ->long_option_alignment_ratio(6/30.f) allows output to look like this:
```
-h, --help Print
--option Something
```
The 1/3 ratio is also bad if you want to print "descriptive" long
options on a single line, because then you might want to increase the
column width, but that means you waste more space on short options.
e.g. ->column_width(46)
```
-l, --very-descriptive-long-option Something
```
vs. ->column_width(38)
```
-l, --very-descriptive-long-option
Something
```
vs. ->column_width(38) ->long_option_alignment_ratio(6/38.f)
```
-l, --very-descriptive-long-option Something
```
Any absolute offset `X` can be set as `X/column_width`, so provide a
ratio-based interface.
I would have prefered to give an absolute integer offset, but we still
have to preserve the functionality that does 1/3 if user changed
nothing, which means that ratio-based interface is simpler.
I don't have a good idea for the name, "short_option_ratio" might work
as well.
The setter does not sanity check that the value is in [0;1] range.
---------
Signed-off-by: Radim Krčmář <radim@krcmar.dev>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>