michaelsproul/rust-nightly-archlinux — pull request #2 by nathantypanski (2014-07-24 02:06:05+00:00)
Title: use argparse to parse cli arguments

Using Python's argparse makes the script's help text better: it's more
detailed and gives the user descriptions for their input. It gives you
consistent internal naming, while letting you change the UI, and it's a
standardized feature across Python packages.

Example usage:

``` bash
rust-nightly-archlinux$ ./make_pkgbuild.py
usage: make_pkgbuild.py [-h] pkgbuild_template rust_makefile
make_pkgbuild.py: error: the following arguments are required: pkgbuild_template, rust_makefile
rust-nightly-archlinux$ ./make_pkgbuild.py -h
usage: make_pkgbuild.py [-h] pkgbuild_template rust_makefile

PKGBUILD generator for Rust nightly

positional arguments:
pkgbuild_template path to PKGBUILD template
rust_makefile path to Rust makefile

optional arguments:
-h, --help show this help message and exit
```