Open konklone opened 9 years ago
Two things. First of all, since the halp syntax is regular across all of sendak (because of sendak-usage
), it should be really easy to parse the output for what each task is "capable" of doing (sendak task --help | cut -d' ' -f 1
); bash tab completion (or, bourne-shell, really, because zsh
does the same thing) just executes commands after tab whacks. You define those commands somewhere in a hints file.
Anyways, so yeah it should not be hard because both --list-tasks
is regular and the --help
is regular for all the tasks. But the other thing to add is that I've been toying with this idea of shell-pluggable
which would make this really easy to do, and would be portable to anything we (we 18F, we Jane, we The People, etc) wanted to subsequently do and have tab completion for.
I don't breathe shell well enough to be super comfortable with cut
, sadly. -_- I'd definitely benefit from tab completion.
I'm not totally done wrapping my head around shell-pluggable
, but I think I get the basic idea - a framework for plugging in subcommands to a central command. Seems like it'd also involve making a meta-format for the bash hints file, that shell-pluggable
compiles to...? Or shell-pluggable
would just demand that pluggable sets of commands put it at some predictable location in their repo...?
For someone, somewhere: I have no idea how custom bash tab completion works, but I know it's a life saver for
git
andgpg
and all sorts of things. It would helpsendak
too.