Skip to content

Instantly share code, notes, and snippets.

@swdyh
Created June 14, 2012 21:27

Revisions

  1. swdyh created this gist Jun 14, 2012.
    16 changes: 16 additions & 0 deletions _mad
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #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