RetroFed Forum
Your home away from modern life.
If you create a man page
Post Reply
AuthorMessage
MonkderVierte lemmy.zip MonkderVierte@lemmy.zip
Joined: 2025-05-30
(edited) Quote

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.

48   Original
jqubed lemmy.world jqubed@lemmy.world
Joined: 2024-01-10
#2 · Quote Reply

I feel like this should go to some of the programming communities also, but I’m not a programmer so I don’t know where

5
GooeyGlob lemmy.world gooeyglob@lemmy.world
Joined: 2023-06-12
#3 · (edited) Quote Reply

/-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.

5
wabasso lemmy.ca wabasso@lemmy.ca
Joined: 2025-01-07
#4 · Quote Reply

/-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.

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 ‘

3
Eager Eagle lemmy.world eager_eagle@lemmy.world
Joined: 2023-07-07
#5 · Quote Reply

I've been using more https://cheat.sh/ or --help on specific commands and subcommands.

It's usually less noise than in a man page, and no need to install a specific man page for each command you want.

0
MonkderVierte lemmy.zip MonkderVierte@lemmy.zip
Joined: 2025-05-30
#6 · (edited) Quote Reply

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 ‘

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.

2
a14o feddit.org a14o@feddit.org
Joined: 2025-01-15
#7 · (edited) Quote Reply

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 ‘

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.

4
GooeyGlob lemmy.world gooeyglob@lemmy.world
Joined: 2023-06-12
#8 · (edited) Quote Reply

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 ‘

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.

2
tvcvt lemmy.ml tvcvt@lemmy.ml
Joined: 2023-06-23
#9 · (edited) Quote Reply

Very interesting idea. I’ve gotten into the habit of using something like /^-o to search for short flags.

3
Post Reply
Back to top