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

InfluxDB - Purpose built for real-time analytics at any scale.
InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • 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.

  • InfluxDB

    Purpose built for real-time analytics at any scale. InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.

    InfluxDB logo
  • 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.

  • 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.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub 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

  • Ask HN: A Bash guide for Posix programmers?

    1 project | news.ycombinator.com | 17 Dec 2023
  • Regex support to list modules in .cabal?

    1 project | /r/haskell | 4 Dec 2023
  • Shellcheck – finds bugs in your shell scripts

    1 project | news.ycombinator.com | 6 Oct 2023
  • Ask HN: How does one practice day to day shell scripting

    2 projects | news.ycombinator.com | 23 Sep 2023
  • ShellCheck: Static analysis tool for shell scripts

    1 project | news.ycombinator.com | 31 Aug 2023

Did you konow that Shell is
the 9th most popular programming language
based on number of metions?