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:
parent
00315bcc9e
commit
8637e7a92f
1 changed files with 7 additions and 7 deletions
|
@ -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=
|
||||
|
|
Loading…
Reference in a new issue