DEV Community

Tea Reggi
Tea Reggi

Posted on • Edited on

1

Bash Flag Conventions

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.

flag description examples
-C Set's working path git, npm
-h Output help git, mongo
--help Output help node, git
-v Output version node, ruby
--version Output version mongo, node, git
--dry-run Detail's action npm
-v Verbose Output bash
--verbose Verbose Output bash

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

Related:

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs