kieranpotts / dotfiles

A baseline, extensible UNIX user configuration.
MIT License
1 stars 0 forks source link

Build help text into Git aliases with parameters #206

Open kieranpotts opened 1 year ago

kieranpotts commented 1 year ago

This is a good example, from https://git.wiki.kernel.org/index.php/Aliases:

[alias]
        alias = "!sh -c '[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1' -"

One option would be to build in a --help parameter, consistent with built-in commands:

git <command> --help