Allow command line options to start with - or --.
It was already the case for the version command line option.
Details
- Reviewers
• leper mimo - Commits
- rP20249: Allow command line options to start with `-` or `--`
Test some command line options like: --version, -version, -replay-visual=somepath and --replay-visual=somepath
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
http://jenkins-master:8080/job/phabricator/1990/ for more details.
Executing section Default... Executing section Source... Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jenkins-master:8080/job/phabricator_lint/505/ for more details.
I mostly added both -version and --version so that the former is consistent with the rest of the options, and the latter is consistent with *nix.
I'd prefer if we would switch to -- for all long options (IIRC we don't have any short options) only, but that might require quite some documentation updates.
Consistency mostly (of examples, command lines by users, etc). Having two equivalent options that do the same might confuse new users. If someone else likes having both I'm not going to object, but I'd prefer one style (and that would be -- for long options, - for short ones (though we don't have any)).
Tested and works as expected.
I don't have strong opinions about keeping both styles or only the "--" for long options, so i'm fine with the patch as it is :)