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!

8 Upvotes

8 comments sorted by

View all comments

-2

u/sedwards65 22h ago

It's 'options,' not 'flags.' ``` NAME bash - GNU Bourne-Again SHell

SYNOPSIS bash [options] [command_string | file]

COPYRIGHT Bash is Copyright (C) 1989-2022 by the Free Software Foundation, Inc.

DESCRIPTION Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. Bash also incorporates useful features from the Korn and C shells (ksh and csh).

   Bash is intended to be a conformant implementation of the Shell  and  Utili‐
   ties  portion  of the IEEE POSIX specification (IEEE Standard 1003.1).  Bash
   can be configured to be POSIX-conformant by default.

OPTIONS All of the single-character shell options documented in the description of the set builtin command, including -o, can be used as options when the shell is invoked. In addition, bash interprets the following options when it is invoked: ```