home-manager: look for '--help' on command line

This is a special case to work around the lack of long options in
`getopts`.
This commit is contained in:
Robert Helgesson 2017-11-12 14:11:59 +01:00
parent 66219f23bb
commit 04ea044917
Failed to generate hash of commit

View file

@ -296,6 +296,15 @@ function doHelp() {
EXTRA_NIX_PATH=()
HOME_MANAGER_CONFIG_ATTRIBUTE=""
# As a special case, if the user has given --help anywhere on the
# command line then print help and exit.
for arg in "$@"; do
if [[ $arg == "--help" ]]; then
doHelp
exit 0
fi
done
while getopts f:I:A:vnh opt; do
case $opt in
f)