Skip to content

Instantly share code, notes, and snippets.

@swdyh
Created June 14, 2012 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swdyh/2933058 to your computer and use it in GitHub Desktop.
Save swdyh/2933058 to your computer and use it in GitHub Desktop.
#compdef mad
_arguments \
'(-U --update-self)'{-U,--update-self}'[update mad(1) itself]' \
'(-u --update)'{-u,--update}'[update remote mad-pages]' \
'(-v --version)'{-v,--version}'[output mad version]' \
'(-h --help)'{-h,--help}'[output this help information]' \
'(-l --list)'{-l,--list}'[list mad-pages]' \
'-[read from stdin]' \
'*:: :->' && return 0
if (( CURRENT == 1 )); then
`mad -l | grep '^ \w' | sed 's/^/compadd /'`
_files -g "*.(md|markdown)"
return
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment