I wrote a Bash script to help me manage some symlinks. It's a wrapper around some Stow commands.
When I invoke it, I pass it two command-line arguments: a command (plug
/unplug
/replug
) and a directory name (just its basename, not a path).
The script is called vlink
, so an invocation would be, for example:
vlink plug foo
The directory name (foo
in the above example) needs to be one of the subdirectories of a specific directory elsewhere on my system.
Since there are only three possible commands (plug
/unplug
/replug
) and a specific set of possible directory names for the third argument, I'd like to provide some tab-completion for it.
I'm somewhat familiar with writing Bash completion scripts, but is there a way to provide completion commands for an executable that's not in my $PATH and is only intended to be run from its parent directory?