7 ms·
If anyone is looking for a snippet to handle both positional args along with required and optional flags (both with short and long form formats) along with basi
by nickjj 4y ago
If anyone is looking for a snippet to handle both positional args along with required and optional flags (both with short and long form formats) along with basic validation I put together: https://nickjanetakis.com/blog/parse-command-line-positional-arguments-and-flags-with-bash https://nickjanetakis.com/blog/parse-command-line-positional..., it includes the source code annotated with comments and a demo video.