2 ms·
I was teaching myself Rust and got tired of doing Project Euler problems. I've always wanted a program that made it easier to parse arguments in shell scripts.
by shaftway 3y ago
I was teaching myself Rust and got tired of doing Project Euler problems. I've always wanted a program that made it easier to parse arguments in shell scripts. Something like Python's ArgParse. So I wrote it.
https://github.com/Shaftway/argparse https://github.com/Shaftway/argparse
Initial implementation took about a weekend. I've tweaked and added features and documentation since then. I've only tested it in Bash and I'd love feature suggestions or a critique of the code from better Rustaceans than me. I've been using it in a couple scripts and have really appreciated the functionality.
My Hello World demo is:
#!/usr/bin/env bash
eval "$(argparse --string name -- "$@")";
echo "Hello $NAME"