Skip to content

Support long command line options with hyphens like --pre-run-modifier #4547

Description

@pekkaklarck

To make long option names like --prerunmodifier easier to read, Robot handles them case-insensitively so that also --PreRunModifier works. This is an old feature and works nicely, but it's inconsistent with the --my-long-option format other tools typically use nowadays. We could easily support also that format simply by removing hyphens from long option values at the same time as we convert them to lower case.

Removing hyphens would make --prerunmodifier, --PreRunModifier and --pre-run-modifier all equivalent. It would also allow stupid usages like --p-r-eru-n-mod-i-fier, but we support also --PReruNmodIfier so it shouldn't be a big deal. The leading two hyphens obviously shouldn't be removed.

Supporting multiple different formats is perhaps not a good idea in general, though, and it could be better to require using a single format instead. I personally prefer the --my-long-option format over the other alternatives because it is consistent with shorter options like --option and also what other tools typically use. I'm not sure is requiring that worth the deprecation effort, but making that format valid now certainly helps if we ever want to do that.

Activity

  1. added this to the v6.1 milestone on Nov 25, 2022
  2. added a commit that references this issue on Feb 7, 2023
    232c116
  3. added
    acknowledge
    on Feb 7, 2023
  4. pekkaklarck commented on Feb 7, 2023

    @pekkaklarck
    MemberAuthor

    This was implemented in great PR #4608 by @Vincema. Thanks for contribution!

  5. added 2 commits that reference this issue on Mar 18, 2023
    b48e3b4
    fa36992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgealpha 1effort: smallgood first issuepriority: medium

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions