archlinux-downgrade / downgrade

Downgrade packages in Arch Linux
GNU General Public License v2.0
570 stars 24 forks source link

Use `getopts` to handle CLI arguments in lower-level scripts #182

Open atreyasha opened 2 years ago

atreyasha commented 2 years ago

:rocket: Feature Request

Checklist

Background

Currently, we handle CLI argument parsing on our own (i.e. without external tools).

Proposed feature

Our workflow would benefit from using getopt to aid CLI argument parsing.

atreyasha commented 2 years ago

We should use POSIX's getopts instead of Bash's getopt for reasons mentioned here:

https://github.com/archlinux-downgrade/downgrade/pull/196#discussion_r854453235

Since getopt only support short arguments, we could use these specifically for lower-level scripts that downgrade calls.