Please add a comma to your short options (-o, --option). This makes it easier to look it up.

Just something i wanted Linuxers to be aware of.

  • GooeyGlob@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    2 hours ago

    /-o\>

    Seems to work, albeit you’ll hit later mentions doing it more than once, but yeah word boundary searches are awesome.

    Agree with your overall suggestion, just a tip for when the man page doesnt cooperate.

    • wabasso@lemmy.ca
      link
      fedilink
      English
      arrow-up
      3
      ·
      8 hours ago

      I believe you but in the spirit of regex, can you explain?

      I guess hyphen is literal outside of square brackets. But then you’re escaping an angle bracket?

      Also curious what trouble OP was having. Wouldn’t a trailing space be enough?

      ‘/-o ‘

      • GooeyGlob@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        2 hours ago

        It depends on how the document is written, but \> stops matching on a period, comma, apostrophe, space, newline, what have you. Word boundary matching is just very handy.

        As to why its that set of characters… Honestly I have no idea :) Regexes are just what they are and I assume the special escape made sense to the inventor at least.

      • a14o@feddit.org
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        6 hours ago

        The problem is that /-o will also match something like --my-irrelevant-option.

        Word boundaries match the end (or the beginning) of the word.

        How exactly to do it depends on the regex library, my less is built with PCRE2 therefore I can do /-o\b.

      • MonkderVierte@lemmy.zipOP
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        6 hours ago

        Also curious what trouble OP was having. Wouldn’t a trailing space be enough?

        Dealing with multiple more complex tools the last few days, looking the short option up, because i needed to know what it does, was about a hundred steps through walls of text. Then came the yay and curl manpages; one or two steps. That’s when i wrote the post.