dotfiles

*nix config files
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

_bower (4425B)


      1 #compdef bower
      2 # ------------------------------------------------------------------------------
      3 # Description
      4 # -----------
      5 #
      6 #  Completion script for Bower (http://bower.io).
      7 #
      8 # ------------------------------------------------------------------------------
      9 # Authors
     10 # -------
     11 #
     12 #  * Joe Lencioni (https://github.com/lencioni)
     13 #
     14 # ------------------------------------------------------------------------------
     15 
     16 
     17 local curcontext="$curcontext" state line _packages _opts ret=1
     18 
     19 _arguments -C -A "-v" -A "--version" \
     20   '(- 1 *)'{-v,--version}'[display version information]' \
     21   '1: :->cmds' \
     22   '*:: :->args' && ret=0
     23 
     24 case $state in
     25   cmds)
     26     _values "bower command" \
     27       "cache[Manage bower cache]" \
     28       "help[Display help information about Bower]" \
     29       "home[Opens a package homepage into your favorite browser]" \
     30       "info[Info of a particular package]" \
     31       "init[Interactively create a bower.json file]" \
     32       "install[Install a package locally]" \
     33       "link[Symlink a package folder]" \
     34       "list[List local packages]" \
     35       "lookup[Look up a package URL by name]" \
     36       "prune[Removes local extraneous packages]" \
     37       "register[Register a package]" \
     38       "search[Search for a package by name]" \
     39       "update[Update a local package]" \
     40       "uninstall[Remove a local package]" \
     41       "version[Bump a package version]"
     42     _arguments \
     43       '(--force)--force[Makes various commands more forceful]' \
     44       '(--json)--json[Output consumable JSON]' \
     45       '(--log-level)--log-level[What level of logs to report]' \
     46       '(--offline)--offline[Do not hit the network]' \
     47       '(--quiet)--quiet[Only output important information]' \
     48       '(--silent)--silent[Do not output anything, besides errors]' \
     49       '(--verbose)--verbose[Makes output more verbose]' \
     50       '(--allow-root)--allow-root[Allows running commands as root]'
     51     ret=0
     52     ;;
     53   args)
     54     case $line[1] in
     55       help)
     56         _values 'commands' \
     57           'cache' \
     58           'home' \
     59           'info' \
     60           'init' \
     61           'install' \
     62           'link' \
     63           'list' \
     64           'lookup' \
     65           'prune' \
     66           'register' \
     67           'search' \
     68           'update' \
     69           'uninstall' \
     70           'version'
     71         ret=0
     72         ;;
     73       (home|info|init|link|lookup|prune|register|search)
     74         _arguments \
     75           '(--help)--help[Show help message]'
     76         ret=0
     77         ;;
     78       install)
     79         _arguments \
     80           '(--force-latest)--force-latest[Force latest version on conflict]' \
     81           '(--help)--help[Show help message]' \
     82           '(--production)--production[Do not install project devDependencies]' \
     83           '(--save)--save[Save installed packages into the project''s bower.json dependencies]' \
     84           '(--save-dev)--save-dev[Save installed packages into the project''s bower.json devDependencies]'
     85         ret=0
     86         ;;
     87       list)
     88         _arguments \
     89           '(--help)--help[Show help message]' \
     90           '(--paths)--paths[Generate a simple JSON source mapping]' \
     91           '(--relative)--relative[Make paths relative to the directory config property, which defaults to bower_components]'
     92         ret=0
     93         ;;
     94       uninstall)
     95         _arguments \
     96           '(--help)--help[Show help message]' \
     97           '(--save)--save[Save installed packages into th projects''s bower.json dependencies]' \
     98           '(--save-dev)--save-dev[Save installed packages into th projects''s bower.json devDependencies]'
     99         ret=0
    100         ;;
    101       update)
    102         _arguments \
    103           '(--force-latest)--force-latest[Force latest version on conflict]' \
    104           '(--help)--help[Show help message]' \
    105           '(--production)--production[Do not install project devDependencies]'
    106         ret=0
    107         ;;
    108       version)
    109         _arguments \
    110           '(--message)--message[Custom git commit and tag message]'
    111         ret=0
    112         ;;
    113       exec)
    114         _normal && ret=0
    115         ;;
    116       *)
    117         _opts=(  $(bower help $line[1] | sed -e '/^  \[-/!d; s/^  \[\(-[^=]*\)=.*/\1/') )
    118         _opts+=( $(bower help $line[1] | sed -e '/^  -/!d; s/^  \(-.\), \[\(-[^=]*\)=.*/\1 \2/') )
    119         if [[ $_opts != "" ]]; then
    120           _values 'options' $_opts && ret=0
    121         fi
    122         ;;
    123     esac
    124     ;;
    125 esac
    126 
    127 return ret
    128 
    129 # Local Variables:
    130 # mode: Shell-Script
    131 # sh-indentation: 2
    132 # indent-tabs-mode: nil
    133 # sh-basic-offset: 2
    134 # End:
    135 # vim: ft=zsh sw=2 ts=2 et