1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

Better no-args darwin-options output

There isn't a man page and it's useful to print out the list of
top-level keys.
This commit is contained in:
Chris Hodapp 2017-05-12 00:31:12 -07:00
parent 00315bcc9e
commit 8637e7a92f

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=