51
submitted 1 day ago* (last edited 1 day ago) by MonkderVierte@lemmy.zip to c/linux@lemmy.ml

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.

top 8 comments
sorted by: hot top controversial new old
[-] tvcvt@lemmy.ml 3 points 18 hours ago* (last edited 18 hours ago)

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

[-] gooeyglob@lemmy.world 5 points 1 day ago* (last edited 22 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 3 points 1 day 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 2 points 22 hours ago* (last edited 22 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 4 points 1 day ago* (last edited 1 day 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.zip 2 points 1 day ago* (last edited 1 day 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.

[-] jqubed@lemmy.world 5 points 1 day ago

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

[-] eager_eagle@lemmy.world 1 points 1 day ago

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.

this post was submitted on 19 Feb 2026
51 points (98.1% liked)

Linux

62524 readers
303 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS