diff --git a/bin/carg b/bin/carg new file mode 100755 index 0000000..a63958f --- /dev/null +++ b/bin/carg @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# This program should be installed as `carg`. It fixes typos like +# +# carg oc -> cargo c +# carg obuild -> cargo build +# +# It unconditionally removes one leading `o` from its first argument and then +# runs the corrected `cargo` subcommand with the rest of the arguments. + +set -euo pipefail + +sub="$1"; shift; +sub="${sub#o}" + +exec cargo "$sub" "$@"