Bash's getopts is really frustrating to work with, so I made a helper that simplifies it to just a line or two

This page summarizes the projects mentioned and recommended in the original post on /r/bash

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • shflags

    shFlags is a port of the Google gflags library for Unix shell.

  • If getopts isn't doing it for you, there are already existing libraries to assist. Kate Ward's shflags and Matěj Týč's argbash are a couple of the better established/known ones. Although there are others e.g.

  • argbash

    Bash argument parsing code generator

  • If getopts isn't doing it for you, there are already existing libraries to assist. Kate Ward's shflags and Matěj Týč's argbash are a couple of the better established/known ones. Although there are others e.g.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • argparse-bash

    Use python's argparse module in shell scripts

  • bash-argsparse

    An high level argument parsing library for bash

  • cmdarg

    A bash library to make argument parsing far less troublesome

  • bash_opts

    SImple Bash options parser

  • ShellCheck

    ShellCheck, a static analysis tool for shell scripts

  • Similarly, conflating arrays and strings is a recipe for confusion. Just because you can obfuscate accessing the zero-th index of an array doesn't mean you should. ShellCheck would flag that too.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts