Thomas Reggi's Profile Image

@thomasreggi 🌸

Bash Flag Conventions

October 2, 2020 (Syndicated From dev.to)

I’ve been thinking about bash / shell flag conventions a bunch lately. I was considering creating a list of commonly shared flags. If you’re making a script and you want to create a flag, it could be confusing to use -v for --velociraptor, because it’s more commonly used for version.

flagdescriptionexamples
-CSet’s working pathgit, npm
-hOutput helpgit, mongo
—helpOutput helpnode, git
-vOutput versionnode, ruby
—versionOutput versionmongo, node, git
—dry-runDetail’s actionnpm
-vVerbose Outputbash
—verboseVerbose Outputbash

Please comment below and I’ll add them to the list. Please provide two scripts that use this flag.

Related: