home-manager: check whether a command is passed
"set -u" treats unset variables as an error, and $1 is unbound when no command is passed.
This commit is contained in:
parent
1b0a5eb54a
commit
e94782ae03
|
@ -337,6 +337,11 @@ done
|
||||||
# Get rid of the options.
|
# Get rid of the options.
|
||||||
shift "$((OPTIND-1))"
|
shift "$((OPTIND-1))"
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
doHelp >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
cmd="$1"
|
cmd="$1"
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue