giving frogblog zsh completion
I always was annoyed, that working with the
frogblog was a pain. One
has to type the correct subject name into the command line. Therefore
you must first get a list of all the subjects by
I wondered always, how to enable completion inside my console. Because i use zsh as my shell, i show here how to enable completion for frogblog in zsh.
The folder where zsh looks for completions are listed in the
variable. You can add the completion file in one of the existing
folders. I created
~/.zsh/complete and added the path to the
$fpath. Here are the additional lines for
Also make sure that the
compinit is autoloaded (what ever that means
;)) and that the right completion menu is known.
Completion file for frogblog
Completion files are named with a starting '_'. Here is the content
_arguments need to be first an action, which can be of the list
(list publish delete). For every one of these actions there are
different argument to be submitted.
list- is the one that has no more arguments
publish- offers all files in the current directory end with
delete- offers the list that
frogblog listwould return
If you want to know more how this mechanism actually works, have a look at the page i found the most useful information about zsh completion: ZSH – Writing own completion functions.