mirror of
https://github.com/nix-community/home-manager
synced 2025-01-25 18:35:01 +01:00
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
38020d9068
commit
21fefbc8f6
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue