5 ms·
I ditched `brew` for `nix` a while back and while the TUI could be more end-user-friendly (to the point that I wrote a wrapper called "ixnay" just so I could do
by pmarreck 2y ago
I ditched `brew` for `nix` a while back and while the TUI could be more end-user-friendly (to the point that I wrote a wrapper called "ixnay" just so I could do "ixnay install <packagename>" as easily as with brew, https://github.com/pmarreck/ixnay https://github.com/pmarreck/ixnay), the overall guarantees make it worth it.
- bokchoi 2y agoI also find the nix command line annoying. I'll give this a try. I like the embedded `#help` documentation!
- Brian_K_White 2y agoSo do I ;) I've had some form of `grep '^#h ' $0` in most of my scripts forever. This one is a purity stunt and doesn't use grep, or anything else: https://github.com/bkw777/pdd.sh https://github.com/bkw777/pdd.sh (the script itself is of no use to you since it only talks to a piece of hardware) The command dispatcher case statement and all the embedded help is in do_cmd() at 2857, and the help reader is help() at 425 I like their explicit #args vs #help One jank in mine is I have a verbosity level setting which affects most messages, and help() uses it to filter some of the help. Normal verbosity shows only the normal help for the normal commands. If verbosity is set higher, then help() shows more commands. The way that's implimented in help() is extra comments that change the behavior of help() as it's scanning the file from top to bottom. When it hits a '#v 2' it starts only displaying the help if the user has currently set verbosity>=2 until further notice. Later down the file it hits a '#v 1' and starts displaying help again... It works but it feels kind of 70's or assembly. #v 1 #h normal help for mortals #h ... #v 2 #h don't confuse the simple folk with this dangerous powerful stuff... #h ... #v 1 #h a few more normal commands #h ... #v 0 #h display this even the user has set verbosity to 0 to request silence #h ...
- pmarreck 2y ago> It works but it feels kind of 70's or assembly. I mean, this is basically all of Bash lol. A very clever idea that has endured since the 70's but also shows it... And yet we get obsessed with "writing perfect Bash" still. The amazing thing is that there are also old "functional shells" like es-shell https://wryun.github.io/es-shell/ https://wryun.github.io/es-shell/ (he still works on this and it is indeed very interesting!)
- pmarreck 2y agoThe help thing works great but it's on the verge of being over-engineered lol Helped that I'm good at regex lol
- pyjamafish 2y agoI wish I had known about ixnay earlier! I also got annoyed of the user experience, to the point where I also wrote my own tool, hdn: https://github.com/seasonedfish/hdn https://github.com/seasonedfish/hdn I added a mention of ixnay to its readme :)
- pmarreck 2y agoThanks for the mention! I just noticed there's a bug with uninstalling. Probably a parsing issue, they must have changed the output of nix for that (this isn't the first time that happened...)