Repository navigation
Read a bare negative number as a positional value in rfl::cli - #16
Closed
clockblocker wants to merge 1 commit into
Closed
clockblocker wants to merge 1 commit into
clockblocker wants to merge 1 commit into
Conversation
This was referenced Nov 13, 2026
clockblocker
force-pushed
the
cli-negative-number-positional
branch
2 times, most recently
from
November 13, 2026 14:58
eba0db8 to
dc4b898
Compare
`-5` or `-.5` on its own was parsed as a short option and failed with "Unknown short argument". The short-option branch now uses looks_like_option(), which the value lookahead already used. As in argparse, this does not apply if the struct has a short option whose name looks like a number, such as rfl::Short<"1", bool> for `ls -1`: then such tokens are short options as before, and negative positionals need `--`. rfl::cli::read passes that one bit to the parser. The public parse_argv, which does not know the struct, still reads such tokens as short options, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clockblocker
force-pushed
the
cli-negative-number-positional
branch
from
November 13, 2026 23:06
dc4b898 to
99500f4
Compare
Owner
Author
|
Superseded by the wave chain: #17. This PR's content was split into smaller single-purpose PRs and reworked; the old branch is left in place. |
clockblocker
added a commit
that referenced
this pull request
Nov 28, 2026
…#120) Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135). Polish from audit #16: - Preserve Wave 1A <sstream> elimination across PatternValidator.hpp, comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp. - Move builtin_error_code_str, parse_builtin_error_code, compose_size_code, and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to trim Error.hpp compile-time weight. - Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with const std::exception& and catch (...). - Guard constant nullptr V::code in validator_code.hpp with if constexpr to avoid GCC 13 -Werror=nonnull. - Add ASan+UBSan unit test coverage for non-std::exception throws in Validator, AllOf, and MapReader.
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…c storage (#70) Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation (handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field) and Wave 1A header trims. Polish from audit #16: - Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows adding it alongside duplicate-key readers / rfl::Alias in Wave 5). - Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports ErrorKind::invalid_value via from_reflection without throwing or adding a one-off is_timestamp_v branch in Parser_default.hpp. - Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader, Validator, Timestamp, ParserTimePoint, Parser_default) with const std::exception& and catch (...). - Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp to avoid ADL ambiguity when reflecting structs in rfl::internal (such as rfl::ErrorDetail). - Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix GCC 13 -Werror=unused-local-typedefs.
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…#120) Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135). Polish from audit #16: - Preserve Wave 1A <sstream> elimination across PatternValidator.hpp, comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp. - Move builtin_error_code_str, parse_builtin_error_code, compose_size_code, and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to trim Error.hpp compile-time weight. - Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with const std::exception& and catch (...). - Guard constant nullptr V::code in validator_code.hpp with if constexpr to avoid GCC 13 -Werror=nonnull. - Add ASan+UBSan unit test coverage for non-std::exception throws in Validator, AllOf, and MapReader.
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…c storage (#70) Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation (handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field) and Wave 1A header trims. Polish from audit #16: - Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows adding it alongside duplicate-key readers / rfl::Alias in Wave 5). - Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports ErrorKind::invalid_value via from_reflection without throwing or adding a one-off is_timestamp_v branch in Parser_default.hpp. - Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader, Validator, Timestamp, ParserTimePoint, Parser_default) with const std::exception& and catch (...). - Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp to avoid ADL ambiguity when reflecting structs in rfl::internal (such as rfl::ErrorDetail). - Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix GCC 13 -Werror=unused-local-typedefs.
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…#120) Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135). Polish from audit #16: - Preserve Wave 1A <sstream> elimination across PatternValidator.hpp, comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp. - Move builtin_error_code_str, parse_builtin_error_code, compose_size_code, and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to trim Error.hpp compile-time weight. - Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with const std::exception& and catch (...). - Guard constant nullptr V::code in validator_code.hpp with if constexpr to avoid GCC 13 -Werror=nonnull. - Add ASan+UBSan unit test coverage for non-std::exception throws in Validator, AllOf, and MapReader.
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…c storage (#70) Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation (handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field) and Wave 1A header trims. Polish from audit #16: - Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows adding it alongside duplicate-key readers / rfl::Alias in Wave 5). - Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports ErrorKind::invalid_value via from_reflection without throwing or adding a one-off is_timestamp_v branch in Parser_default.hpp. - Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader, Validator, Timestamp, ParserTimePoint, Parser_default) with const std::exception& and catch (...). - Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp to avoid ADL ambiguity when reflecting structs in rfl::internal (such as rfl::ErrorDetail). - Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix GCC 13 -Werror=unused-local-typedefs.
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…#120) Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135). Polish from audit #16: - Preserve Wave 1A <sstream> elimination across PatternValidator.hpp, comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp. - Move builtin_error_code_str, parse_builtin_error_code, compose_size_code, and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to trim Error.hpp compile-time weight. - Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with const std::exception& and catch (...). - Guard constant nullptr V::code in validator_code.hpp with if constexpr to avoid GCC 13 -Werror=nonnull. - Add ASan+UBSan unit test coverage for non-std::exception throws in Validator, AllOf, and MapReader.
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…c storage (#70) Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation (handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field) and Wave 1A header trims. Polish from audit #16: - Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows adding it alongside duplicate-key readers / rfl::Alias in Wave 5). - Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports ErrorKind::invalid_value via from_reflection without throwing or adding a one-off is_timestamp_v branch in Parser_default.hpp. - Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader, Validator, Timestamp, ParserTimePoint, Parser_default) with const std::exception& and catch (...). - Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp to avoid ADL ambiguity when reflecting structs in rfl::internal (such as rfl::ErrorDetail). - Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix GCC 13 -Werror=unused-local-typedefs.
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…#120) Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135). Polish from audit #16: - Preserve Wave 1A <sstream> elimination across PatternValidator.hpp, comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp. - Move builtin_error_code_str, parse_builtin_error_code, compose_size_code, and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to trim Error.hpp compile-time weight. - Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with const std::exception& and catch (...). - Guard constant nullptr V::code in validator_code.hpp with if constexpr to avoid GCC 13 -Werror=nonnull. - Add ASan+UBSan unit test coverage for non-std::exception throws in Validator, AllOf, and MapReader.
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…c storage (#70) Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation (handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field) and Wave 1A header trims. Polish from audit #16: - Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows adding it alongside duplicate-key readers / rfl::Alias in Wave 5). - Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports ErrorKind::invalid_value via from_reflection without throwing or adding a one-off is_timestamp_v branch in Parser_default.hpp. - Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader, Validator, Timestamp, ParserTimePoint, Parser_default) with const std::exception& and catch (...). - Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp to avoid ADL ambiguity when reflecting structs in rfl::internal (such as rfl::ErrorDetail). - Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix GCC 13 -Werror=unused-local-typedefs.
clockblocker
added a commit
that referenced
this pull request
Nov 29, 2026
…#120) Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135). Polish from audit #16: - Preserve Wave 1A <sstream> elimination across PatternValidator.hpp, comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp. - Move builtin_error_code_str, parse_builtin_error_code, compose_size_code, and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to trim Error.hpp compile-time weight. - Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with const std::exception& and catch (...). - Guard constant nullptr V::code in validator_code.hpp with if constexpr to avoid GCC 13 -Werror=nonnull. - Add ASan+UBSan unit test coverage for non-std::exception throws in Validator, AllOf, and MapReader.
clockblocker
added a commit
that referenced
this pull request
Nov 30, 2026
…c storage (#70) Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation (handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field) and Wave 1A header trims. Polish from audit #16: - Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows adding it alongside duplicate-key readers / rfl::Alias in Wave 5). - Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports ErrorKind::invalid_value via from_reflection without throwing or adding a one-off is_timestamp_v branch in Parser_default.hpp. - Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader, Validator, Timestamp, ParserTimePoint, Parser_default) with const std::exception& and catch (...). - Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp to avoid ADL ambiguity when reflecting structs in rfl::internal (such as rfl::ErrorDetail). - Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix GCC 13 -Werror=unused-local-typedefs.
clockblocker
added a commit
that referenced
this pull request
Nov 30, 2026
…#120) Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135). Polish from audit #16: - Preserve Wave 1A <sstream> elimination across PatternValidator.hpp, comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp. - Move builtin_error_code_str, parse_builtin_error_code, compose_size_code, and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to trim Error.hpp compile-time weight. - Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with const std::exception& and catch (...). - Guard constant nullptr V::code in validator_code.hpp with if constexpr to avoid GCC 13 -Werror=nonnull. - Add ASan+UBSan unit test coverage for non-std::exception throws in Validator, AllOf, and MapReader.
clockblocker
added a commit
that referenced
this pull request
Nov 30, 2026
…c storage (#70) Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation (handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field) and Wave 1A header trims. Polish from audit #16: - Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows adding it alongside duplicate-key readers / rfl::Alias in Wave 5). - Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports ErrorKind::invalid_value via from_reflection without throwing or adding a one-off is_timestamp_v branch in Parser_default.hpp. - Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader, Validator, Timestamp, ParserTimePoint, Parser_default) with const std::exception& and catch (...). - Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp to avoid ADL ambiguity when reflecting structs in rfl::internal (such as rfl::ErrorDetail). - Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix GCC 13 -Werror=unused-local-typedefs.
clockblocker
added a commit
that referenced
this pull request
Nov 30, 2026
…#120) Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135). Polish from audit #16: - Preserve Wave 1A <sstream> elimination across PatternValidator.hpp, comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp. - Move builtin_error_code_str, parse_builtin_error_code, compose_size_code, and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to trim Error.hpp compile-time weight. - Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with const std::exception& and catch (...). - Guard constant nullptr V::code in validator_code.hpp with if constexpr to avoid GCC 13 -Werror=nonnull. - Add ASan+UBSan unit test coverage for non-std::exception throws in Validator, AllOf, and MapReader.
clockblocker
added a commit
that referenced
this pull request
Nov 30, 2026
…c storage (#70) Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation (handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field) and Wave 1A header trims. Polish from audit #16: - Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows adding it alongside duplicate-key readers / rfl::Alias in Wave 5). - Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports ErrorKind::invalid_value via from_reflection without throwing or adding a one-off is_timestamp_v branch in Parser_default.hpp. - Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader, Validator, Timestamp, ParserTimePoint, Parser_default) with const std::exception& and catch (...). - Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp to avoid ADL ambiguity when reflecting structs in rfl::internal (such as rfl::ErrorDetail). - Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix GCC 13 -Werror=unused-local-typedefs.
clockblocker
added a commit
that referenced
this pull request
Nov 30, 2026
…#120) Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135). Polish from audit #16: - Preserve Wave 1A <sstream> elimination across PatternValidator.hpp, comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp. - Move builtin_error_code_str, parse_builtin_error_code, compose_size_code, and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to trim Error.hpp compile-time weight. - Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with const std::exception& and catch (...). - Guard constant nullptr V::code in validator_code.hpp with if constexpr to avoid GCC 13 -Werror=nonnull. - Add ASan+UBSan unit test coverage for non-std::exception throws in Validator, AllOf, and MapReader.
clockblocker
added a commit
that referenced
this pull request
Dec 1, 2026
…c storage (#70) Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation (handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field) and Wave 1A header trims. Polish from audit #16: - Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows adding it alongside duplicate-key readers / rfl::Alias in Wave 5). - Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports ErrorKind::invalid_value via from_reflection without throwing or adding a one-off is_timestamp_v branch in Parser_default.hpp. - Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader, Validator, Timestamp, ParserTimePoint, Parser_default) with const std::exception& and catch (...). - Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp to avoid ADL ambiguity when reflecting structs in rfl::internal (such as rfl::ErrorDetail). - Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix GCC 13 -Werror=unused-local-typedefs.
clockblocker
added a commit
that referenced
this pull request
Dec 1, 2026
…#120) Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135). Polish from audit #16: - Preserve Wave 1A <sstream> elimination across PatternValidator.hpp, comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp. - Move builtin_error_code_str, parse_builtin_error_code, compose_size_code, and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to trim Error.hpp compile-time weight. - Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with const std::exception& and catch (...). - Guard constant nullptr V::code in validator_code.hpp with if constexpr to avoid GCC 13 -Werror=nonnull. - Add ASan+UBSan unit test coverage for non-std::exception throws in Validator, AllOf, and MapReader.
clockblocker
added a commit
that referenced
this pull request
Dec 1, 2026
…c storage (#70) Rebased onto wave1/stack-tip (428fa25), preserving Wave 1D symbol isolation (handle_missing_named_tuple_field, FieldNameLookup, write_named_tuple_field) and Wave 1A header trims. Polish from audit #16: - Omit ErrorKind::duplicate_field (0 emission sites in 4A; open enum allows adding it alongside duplicate-key readers / rfl::Alias in Wave 5). - Retain HasFromReflectionMethod Result<T> support so rfl::Timestamp reports ErrorKind::invalid_value via from_reflection without throwing or adding a one-off is_timestamp_v branch in Parser_default.hpp. - Harden touched noexcept boundaries (NamedTupleParser, TupleReader, MapReader, Validator, Timestamp, ParserTimePoint, Parser_default) with const std::exception& and catch (...). - Qualify cpp20::apply_to_fields / cpp26::apply_to_fields in bind_to_tuple.hpp to avoid ADL ambiguity when reflecting structs in rfl::internal (such as rfl::ErrorDetail). - Hoist CustomConvertible out of function scope in test_error_kind.cpp to fix GCC 13 -Werror=unused-local-typedefs.
clockblocker
added a commit
that referenced
this pull request
Dec 1, 2026
…#120) Stacked cleanly on wave4/error-kind (4A) and Wave 1A (#135). Polish from audit #16: - Preserve Wave 1A <sstream> elimination across PatternValidator.hpp, comparisons.hpp, AnyOf.hpp, OneOf.hpp, and internal/cpp20/Result.hpp. - Move builtin_error_code_str, parse_builtin_error_code, compose_size_code, and compose_code_points_code out-of-line into src/rfl/internal/Error.cpp (wired into src/reflectcpp.cpp with RFL_API declarations in Error.hpp) to trim Error.hpp compile-time weight. - Fix P0 missing catch (...) in MapReader.hpp (both validator and non-validator key paths) and harden Validator.hpp and AllOf.hpp noexcept boundaries with const std::exception& and catch (...). - Guard constant nullptr V::code in validator_code.hpp with if constexpr to avoid GCC 13 -Werror=nonnull. - Add ASan+UBSan unit test coverage for non-std::exception throws in Validator, AllOf, and MapReader.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI-authored
A bare negative number could not be passed as a positional value. With
rfl::Positional<int> count, reading{"program", "-5"}failed withUnknown short argument: -5, and-.5failed the same way for adouble.parse_argvsent every token that starts with-to the short-option branch.The short-option branch now checks
looks_like_option(arg_raw), the same check the value lookahead already used. A-followed by a digit or.(-5,-1.5,-1e3) is no longer an option, so the token falls through to the positional arguments.Digit short options keep working. As in argparse, the rule is off when the struct declares a short option whose name looks like a number: with
rfl::Short<"1", std::optional<bool>>,ls -1sets the flag as on main, and a-<digit>token is a short option, so a negative positional needs--(ls -1 -- -5). Right after a short option, such a token is still that option's value, as on main: withrfl::Short<"n", int>,-n -1setsnto-1.rfl::cli::readpasses that one bit to the parser (internal::parse_args). The publicparse_argv, which doesn't know the struct, is unchanged from main:-<digit>…tokens are short options there (-1 xgives-1=x).Other short options (
-v,-x=value,-x value) are unaffected.-infand-nanstart with a letter, so they stay short options;cli.mdnow says to pass them after--or as--key=-inf.--x=-5and-n -5already worked and are now tested.Tests in
tests/cli/test_positional.cpp:test_positional_negative_numbers,test_positional_negative_number_forms(-10,-0,-1.5,-1e3),test_positional_negative_infinity_needs_separator,test_negative_option_values,test_digit_short_option,test_digit_short_option_makes_negative_numbers_options,test_parse_argv_reads_negative_numbers_as_options. All 79 cli tests pass; every cli test file compiles with GCC 16-Wall -Werror.🤖 Generated with Claude Code