1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-05 08:17:01 +00:00

Merge pull request #27 from clhodapp/fix/empty-options

Better no-args darwin-options output
This commit is contained in:
Daiderd Jordan 2017-05-12 22:30:25 +02:00 committed by GitHub
commit a8aee53b9b

View file

@ -3,13 +3,6 @@ set -e
set -o pipefail
export PATH=@path@:$PATH
showSyntax() {
echo "$0: <option>" >&2
exec man darwin-option
exit 1
}
evalNix() {
nix-instantiate --eval --strict -E "with import <darwin> {}; $@"
}
@ -22,6 +15,13 @@ evalOpt() {
evalNix "options.$option.$@" 2>/dev/null
}
showSyntax() {
echo "$0: <option>" >&2
eval printf $(evalAttrs "options")
echo
exit 1
}
# Parse the command line.
origArgs=("$@")
option=