fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
47b0d0c29
master
1function __bower_cmds 2echo -en"cache\tManage bower cache 3help\tDisplay help information about Bower 4home\tOpens a package homepage into your favorite browser 5info\tInfo of a particular package 6init\tInteractively create a bower.json file 7install\tInstall a package locally 8link\tSymlink a package folder 9list\tList local packages - and possible updates 10login\tAuthenticate with GitHub and store credentials 11lookup\tLook up a single package URL by name 12prune\tRemoves local extraneous packages 13register\tRegister a package 14search\tSearch for packages by name 15update\tUpdate a local package 16uninstall\tRemove a local package 17unregister\tRemove a package from the registry 18version\tBump a package version 19" 20end 21 22function __bower_args 23echo -en"-f\tMakes various commands more forceful 24--force\tMakes various commands more forceful 25-j\tOutput consumable JSON 26--json\tOutput consumable JSON 27-l\tWhat level of logs to report 28--loglevel\tWhat level of logs to report 29-o\tDo not hit the network 30--offline\tDo not hit the network 31-q\tOnly output important information 32--quiet\tOnly output important information 33-s\tDo not output anything, besides errors 34--silent\tDo not output anything, besides errors 35-V\tMakes output more verbose 36--verbose\tMakes output more verbose 37--allow-root\tAllows running commands as root 38-v\tOutput Bower version 39--version\tOutput Bower version 40--no-color\tDisable colors" 41end 42 43function __bower_matching_pkgs 44bower search( commandline -ct) | string match -r"\S+[^\s]" | string match -v Search 45end 46 47# Output of `bower list` is a) slow, b) convoluted. Use `python` or `jq` instead. 48function __bower_list_installed 49if not test -e bower.json 50return 1 51end 52 53if set -l python( __fish_anypython ) 54# Warning: That weird indentation is necessary, because python. 55$python -S -c'import json, sys; data = json.load(sys.stdin); 56for k,v in data["dependencies"].items(): print(k + "\t" + v[:18])' < bower.json2> /dev/null 57return 58end 59 60if not type -q jq 61return 1 62end 63 64jq -r'.dependencies | to_entries[] | .key' bower.json 65end 66 67complete -c bower -n"__fish_is_nth_token 1" -x -a'(__bower_cmds)' 68complete -c bower -n __fish_should_complete_switches -x -a'(__bower_args)' 69complete -c bower -n"__fish_seen_subcommand_from install" -x -a'(__bower_matching_pkgs)' 70complete -c bower -n"__fish_seen_subcommand_from uninstall" -x -a'(__bower_list_installed)'