Follow-up to #28802
This PR enforces the invariant that option names are unique across categories.
-<ins>Rationale</ins>:
While adapting the
argsman_tests.cppcases introduced in #28802 for the GNU-style parsing changes proposed in #33540, I noticed that the same option name can currently be registered in multiple categories.At present in
master, this ambiguity is largely masked by the existing command-line parsing behaviour. However, it relies on assumptions about how options are interpreted based on their position. Future changes to option parsing, such as the GNU-style parsing proposed in #33540, may expose this ambiguity and lead to unexpected option resolution.To avoid ambiguous option resolution and make the distinction between global and command-specific options explicit, this PR adds validation in
AddArg()preventing the same option name from being registered across different categories.