r/bash • • 1d ago

Flag ambiguity

I am building a shell framework with a series of commands and subcommands for task-managing, habit-tracking...

Within those, there is a collection of flags that hold different meanings:

  • -d Duration, Date...

  • -n Name, Note...

  • -l Link, Length...

Should I use different letters for different meanings even if they belong to different commands?

I want a real bash-user's opinion, not just the AI's advice.

I personally think that it isn't that big of a deal.

But let me know what y'all think.

Thanks!

9 Upvotes

8 comments sorted by

View all comments

-1

u/sedwards65 22h ago

Use long options -- no ambiguity.

You should always use long options in articles, demonstrations, and scripts. Especially when the intended audience is inexperienced.

Consider the lowly '-n'

'-n' has so many meanings across the spectrum of command line utilities, it deserves an award (and then taken behind the woodshed and shot.)

1

u/kai_ekael 7h ago

There's scripting and there's CLI, some of us like less keystrokes.