Getting Started
Welcome to ParseArger. If you're here, you're probably tired of writing while getopts loops and case statements that look like they were written by a drunk cat walking on a keyboard.
Installation
The easiest way to install is via the installer script. It downloads the source, sets permissions, and sets up your environment variables.
# download the script
curl -s https://raw.githubusercontent.com/DimitriGilbert/parseArger/main/utils/get_parseArger -O
# make it executable
chmod +x get_parseArger
# install (this modifies your bashrc/zshrc)
./get_parseArger --install
# source your rc file (only needed once right now)
source "$HOME/.bashrc"Quick Start: The Project Way
Don't just create a script. Create a project. ParseArger can scaffold an entire directory structure for you, complete with subcommands, documentation, and installers.
>
parseArger project my-awesome-tool \ --description "Tools for world domination" \ --git-repo "user/domination-tools" \ --project-subcommand ignite \ --project-subcommand destroy
This creates a folder my-awesome-tool with everything you need. Cd into it and look around. It's beautiful.
Quick Start: The Script Way
Just want a single script? Fine. Be that way.
>
parseArger generate \ --pos 'filename "the file to process"' \ --opt 'output "where to put the result"' \ --flag 'verbose "yell at me"' \ --output ./process-file.sh
Now run it:
>
./process-file.sh --help
USAGE: process-file.sh [options] <filename> ARGUMENTS: <filename> the file to process OPTIONS: --output <output> where to put the result FLAGS: --verbose yell at me --help show this help message --version show version