for comparison: I have ~/bin and I don't distinguish between compiled and scripted personal commands.
I usually don't create "--help" options for personal scripts. Most of my personal scripts are mostly designed to be extremely specific and be so damn obvious how to use them because the --help's of other commands are too complicated.
Some examples of my scripts in ~/bin/scripts/:
ffmpeg-extract-sound
ffmpeg-jpegs-to-video
ffmpeg-video-to-jpegs
ffmpeg-ogv-to-mp4
convert-png-rgb24-to-grey8
iptables-ignore-rst-packets
jabra-stop-changing-volume-goddamnit
apt-remove-arm64-shit-that-nvidias-tx2-installer-installed-onto-my-x86-system
ipv6-on
ipv6-off
ros-install-this
etc.
help-script(){ "${EDITOR:?vi}" "$(which "$1")"; }
I don't actually use that but the point stands -- If the script is simple enough, you don't need a --help; comments in the source work just as well.c@host:~$ ls ~/bin | wc- l 97
#! /usr/bin/env nix-shell
#! nix-shell --pure -i bash -p "hello"
hello
a more realistic example is[1] which generates[2], and if necessary, the Nixpkgs revision can be pinned to fix the dependencies in time. This approach also extends across languages and some of my scripts are written in Haskell which is interpreted!The upshot of all this is that you can write reproducible shell scripts as if you had every package in Nixpkgs available to you, and share it easily with others.
[0] https://nix.dev/tutorials/ad-hoc-developer-environments.html...
[1]: https://ianthehenry.com/posts/how-to-learn-nix/command-refer...
Also, thanks for being dedicated enough to read the entire manual and give your impressions! If you spot typos, things that could be clearer, etc. please let us know on Freenode #nixos-dev or the Nixpkgs issue tracker!
Do you also plan on covering flakes? Flakes are currently gaining adopting in the Nix ecosystem and are pretty exciting, since they resolve issues like ad-hoc project structuring, and since evaluation will now be pure, results can be cached aggressively and nix-shell will be much much faster.
EDIT: Oh, and autocomplete works with it by default. Just 'mkdir ~/bin' and you're good to go.
The end result is very similar to this approach, I run "sysbox blah", or "sysbox help", and use integrated subcommands.
Very helpful and makes deployment easy by having only a single binary:
Not bash/shell, but similar and useful idea to experiment with.
edit-env -ds dump-data.sh
and it will open a script for editing which will only be available to run in the project's directory. It would be callable as the bash function `dump-data`. I've got lots of useful little things like that now that I wouldn't necessarily want to be stored in the project's VC but that I find useful.I really like using the folder structure to have 'subcommands' (i.e. 'sd blog publish' ). Very neat!