sd – a cozy nest for your scripts
ianthehenry.com
ianthehenry.com
Maybe using '.' would work (ie. blog.publish) but the sub-command pattern (ie space separating) seems well established and slightly easier than typing '.'
I mean, yeah, sd is only a marginal improvement over not sd. It's not a lifechanging script. The differences are:
1. sd makes it easier to create new scripts. Instead of vim ~/bin/blog_publish, writing out the shebang, chmod +x ~/bin/blog_publish, you say `sd blog publish --new`. It sets the permissions and preloads it with a template.
2. Ditto for for other convenience commands: `sd blog publish --edit`, `sd blog publish --cat`.
3. Auto-generates usage text in the autocomplete menu.
4. sd scripts exist in a separate autocomplete namespace from non-sd scripts. b<tab> gives you, you know, bison, binhex, any commands on your PATH. sd b<tab> gives you only your user scripts that start with b.
5. Hierarchical autocomplete is more convenient, if you have more than one level of namespacing.
https://git.herrbischoff.com/dotpr0n/tree/.config/fish/compl...
I’m using “s” for a name instead of “sd” though, since there’s also https://news.ycombinator.com/item?id=24246069
https://github.com/chmln/sd (a modern sed alternative)
However, while the bash manual says that, in theory, this is a thing, in practice I've found that completion on aliases simply doesn't work. You need to manually redefine the completions from scratch for your aliases.
Given that limitation, I don't see much benefit from this versus a simple wrapper-script using 'case' to redirect to sub-script with their own completion. The latter has the benefit that you don't need a third party library for it.
Still a cool little project though. Kudos. It does feel like one of those "solution looking for a good problem" situations; maybe there's a really nice problem out there that this solves fantastically.
If you're interested in ways to better-manage small scripts and wrappers more locally, please take a look at my project, Run: