Features
Easy Argument Definition
Add arguments with long names (--arg) and short options (-a) in a simple, intuitive way.
Multiple Argument Types
Support for strings, boolean flags, positional arguments, and subcommands.
Auto Help Generation
Automatically generate comprehensive --help messages with descriptions and usage.
Shell Completion
Generate autocompletion scripts for Bash and Zsh shells.
POSIX Compatible
Works across different shells (bash, zsh, dash, ksh) for maximum portability.
Choice Validation
Validate argument values.
Installation
$ # Download and install auxilium.sh $ sudo mkdir -p /usr/local/lib/auxilium $ sudo cp auxilium.sh /usr/local/lib/auxilium/
Usage
#!/bin/sh # Source the library . /usr/local/lib/auxilium/auxilium.sh # Initialize auxilium_init "myapp" -m "My application description" # Add arguments auxilium_add "verbose" -s v -t opt -m "Enable verbose mode" auxilium_add "config" -s c -d "/etc/app.conf" -m "Config file" auxilium_add "format" -l "json|xml|yaml" -m "Output format" # Parse arguments auxilium_parse "$@" # Use parsed values echo "Config: $AUXILIUM_ARG_CONFIG" [ "$AUXILIUM_ARG_VERBOSE" = "1" ] && echo "Verbose mode" # Cleanup auxilium_close
Examples
Description: My application description Usage: myapp [-h|--help] [-v|--verbose] [-c|--config CONFIG] [--format FORMAT] Optional Arguments: -h|--help This help message -v|--verbose Enable verbose mode -c|--config CONFIG Config file Default: /etc/app.conf --format FORMAT Output format Choice: json|xml|yaml