Is there a recommended alternative to getopts?

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

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

    Bash argument parsing code generator

  • Yeah, now that I look at it a bit closer, it is quirky. Not unmanageable, but I think I prefer something like Argparse which generates the parsing code for you using a simpler language.

  • sh_libpath

    Making shell scripts more robust with libraries

  • There are a number of library files that offer a range of arg handling possibilities in different ways, I collated several of them here, but I don't have a favourite.

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

    An elegant option/argument parser for shell scripts (full support for bash and all POSIX shells)

  • I like to use https://github.com/ko1nksm/getoptions

  • shflags

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

  • Wow thanks! I just found another option, https://github.com/kward/shflags, but yours looks even better.

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