Skip to content

Example under _regex_arguments section is different from the explanation for the example itself? #1106

Open
@fishBone000

Description

Here is an example:
#+BEGIN_SRC sh
_regex_arguments _cmd /$'[^\0]##\0'/ \( /$'word1(a|b|c)\0'/ ':word:first word:(word1a word1b word1c)' '|'\
/$'word11(a|b|c)\0'/ ':word:first word:(word11a word11b word11c)' \( /$'word2(a|b|c)\0'/ ':word:second word:(word2a word2b word2c)'\
'|' /$'word22(a|b|c)\0'/ ':word:second word:(word22a word22b word22c)' \) \)
_cmd "$@"
#+END_SRC
in this case the first word can be word1 or word11 followed by an a, b or c, and if the first word contains 11 then a second
word is allowed which can be word2 followed by and a, b, or c, or a filename.

The explanation for the example and the example itself seems a bit different?

The example seems to say that we should match:

  • Any non-empty command
  • Any branch below
    • word1(a|b|c)
    • word11(a|b|c)
      • Any branch below
        • word2(a|b|c)
        • word22(a|b|c)

But the explanation says something else, like the second word can be word2(a|b|c) or a filename.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions