full disclosure i have never used c-style getopt before

This commit is contained in:
rhiannon morris 2022-05-20 16:50:24 +02:00
parent 48763d2fed
commit 9f084fcd32
1 changed files with 6 additions and 2 deletions

8
bin/nd
View File

@ -2,12 +2,16 @@
importas -D /bin/bash default_shell SHELL
elgetopt s
elgetopt s:
importas -D $default_shell shell ELGETOPT_s
elgetpositionals
getcwd -E cwd
backtick -E nixdir { find-parent -d flake.nix }
backtick -D "" -E nixdir { find-parent -d flake.nix }
ifelse { test $nixdir = "" } {
foreground { echo "flake.nix not found in parents of ${cwd}" }
exit 1
}
cd $nixdir
nix develop $@ -c execlineb -c "cd ${cwd} ${shell}"