Browse code

adapt brew,gem,pip plugin to new structure

Daniel Schauenberg authored on 01/10/2010 at 08:59:48
Showing 11 changed files
1 1
deleted file mode 100644
... ...
@@ -1,69 +0,0 @@
1
-#compdef brew
2
-#autoload
3
-
4
-# imported from the latest homebrew contributions
5
-
6
-_brew_all_formulae() {
7
-  formulae=(`brew search`)
8
-}
9
-
10
-_brew_installed_formulae() {
11
-  installed_formulae=(`brew list`)
12
-}
13
-
14
-local -a _1st_arguments
15
-_1st_arguments=(
16
-  'cat:display formula file for a formula'
17
-  'cleanup:uninstall unused and old versions of packages'
18
-  'create:create a new formula'
19
-  'deps:list dependencies and dependants of a formula'
20
-  'doctor:audits your installation for common issues'
21
-  'edit:edit a formula'
22
-  'home:visit the homepage of a formula or the brew project'
23
-  'info:information about a formula'
24
-  'install:install a formula'
25
-  'link:link a formula'
26
-  'list:list files in a formula or not-installed formulae'
27
-  'log:git commit log for a formula'
28
-  'outdated:list formulas for which a newer version is available'
29
-  'prune:remove dead links'
30
-  'remove:remove a formula'
31
-  'search:search for a formula (/regex/ or string)'
32
-  'unlink:unlink a formula'
33
-  'update:freshen up links'
34
-  'uses:show formulas which depend on a formula'
35
-)
36
-
37
-local expl
38
-local -a formula installed_formulae
39
-
40
-_arguments \
41
-  '(-v --verbose)'{-v,--verbose}'[verbose]' \
42
-  '(--version)--version[version information]' \
43
-  '(--prefix)--prefix[where brew lives on this system]' \
44
-  '(--cache)--cache[brew cache]' \
45
-  '*:: :->subcmds' && return 0
46
-
47
-if (( CURRENT == 1 )); then
48
-  _describe -t commands "brew subcommand" _1st_arguments
49
-  return
50
-fi
51
-
52
-case "$words[1]" in
53
-  list)
54
-    _arguments \
55
-      '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
56
-      '1: :->forms' &&  return 0
57
-
58
-      if [[ "$state" == forms ]]; then
59
-        _brew_installed_formulae
60
-        _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
61
-      fi ;;
62
-  install|home|log|info|uses|cat|deps)
63
-    _brew_all_formulae
64
-    _wanted formulae expl 'all formulae' compadd -a formulae ;;
65
-  remove|edit|xo)
66
-    _brew_installed_formulae
67
-    _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
68
-esac
69
-
70 1
deleted file mode 100644
... ...
@@ -1,64 +0,0 @@
1
-#compdef gem
2
-#autoload
3
-
4
-# gem zsh completion, based on homebrew completion
5
-
6
-_gem_installed() {
7
-  installed_gems=(`gem list --local --no-versions`)
8
-}
9
-
10
-local -a _1st_arguments
11
-_1st_arguments=(
12
-  'cert:Manage RubyGems certificates and signing settings'
13
-  'check:Check installed gems'
14
-  'cleanup:Clean up old versions of installed gems in the local repository'
15
-  'contents:Display the contents of the installed gems'
16
-  'dependency:Show the dependencies of an installed gem'
17
-  'environment:Display information about the RubyGems environment'
18
-  'fetch:Download a gem and place it in the current directory'
19
-  'generate_index:Generates the index files for a gem server directory'
20
-  'help:Provide help on the `gem` command'
21
-  'install:Install a gem into the local repository'
22
-  'list:Display gems whose name starts with STRING'
23
-  'lock:Generate a lockdown list of gems'
24
-  'mirror:Mirror a gem repository'
25
-  'outdated:Display all gems that need updates'
26
-  'owner:Manage gem owners on RubyGems.org.'
27
-  'pristine:Restores installed gems to pristine condition from files located in the gem cache'
28
-  'push:Push a gem up to RubyGems.org'
29
-  'query:Query gem information in local or remote repositories'
30
-  'rdoc:Generates RDoc for pre-installed gems'
31
-  'search:Display all gems whose name contains STRING'
32
-  'server:Documentation and gem repository HTTP server'
33
-  'sources:Manage the sources and cache file RubyGems uses to search for gems'
34
-  'specification:Display gem specification (in yaml)'
35
-  'stale:List gems along with access times'
36
-  'uninstall:Uninstall gems from the local repository'
37
-  'unpack:Unpack an installed gem to the current directory'
38
-  'update:Update the named gems (or all installed gems) in the local repository'
39
-  'which:Find the location of a library file you can require'
40
-)
41
-
42
-local expl
43
-local -a gems installed_gems
44
-
45
-_arguments \
46
-  '(-v --version)'{-v,--version}'[show version]' \
47
-  '(-h --help)'{-h,--help}'[show help]' \
48
-  '*:: :->subcmds' && return 0
49
-
50
-if (( CURRENT == 1 )); then
51
-  _describe -t commands "gem subcommand" _1st_arguments
52
-  return
53
-fi
54
-
55
-case "$words[1]" in
56
-  list)
57
-      if [[ "$state" == forms ]]; then
58
-        _gem_installed
59
-        _requested installed_gems expl 'installed gems' compadd -a installed_gems
60
-      fi ;;
61
-  uninstall|update)
62
-    _gem_installed
63
-    _wanted installed_gems expl 'installed gems' compadd -a installed_gems ;;
64
-esac
65 1
deleted file mode 100644
... ...
@@ -1,46 +0,0 @@
1
-#compdef pip
2
-#autoload
3
-
4
-# pip zsh completion, based on homebrew completion
5
-
6
-_pip_installed() {
7
-  installed_pkgs=(`pip freeze`)
8
-}
9
-
10
-local -a _1st_arguments
11
-_1st_arguments=(
12
-  'bundle:Create pybundles (archives containing multiple packages)'
13
-  'freeze:Output all currently installed packages (exact versions) to stdout'
14
-  'help:Show available commands'
15
-  'install:Install packages'
16
-  'search:Search PyPI'
17
-  'uninstall:Uninstall packages'
18
-  'unzip:Unzip individual packages'
19
-  'zip:Zip individual packages'
20
-)
21
-
22
-local expl
23
-local -a pkgs installed_pkgs
24
-
25
-_arguments \
26
-  '(--version)--version[Show version number of program and exit]' \
27
-  '(-v --verbose)'{-v,--verbose}'[Give more output]' \
28
-  '(-q --quiet)'{-q,--quiet}'[Give less output]' \
29
-  '(-h --help)'{-h,--help}'[Show help]' \
30
-  '*:: :->subcmds' && return 0
31
-
32
-if (( CURRENT == 1 )); then
33
-  _describe -t commands "pip subcommand" _1st_arguments
34
-  return
35
-fi
36
-
37
-case "$words[1]" in
38
-  list)
39
-      if [[ "$state" == forms ]]; then
40
-        _pip_installed
41
-        _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
42
-      fi ;;
43
-  uninstall)
44
-    _pip_installed
45
-    _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
46
-esac
47 1
new file mode 100644
... ...
@@ -0,0 +1,69 @@
0
+#compdef brew
1
+#autoload
2
+
3
+# imported from the latest homebrew contributions
4
+
5
+_brew_all_formulae() {
6
+  formulae=(`brew search`)
7
+}
8
+
9
+_brew_installed_formulae() {
10
+  installed_formulae=(`brew list`)
11
+}
12
+
13
+local -a _1st_arguments
14
+_1st_arguments=(
15
+  'cat:display formula file for a formula'
16
+  'cleanup:uninstall unused and old versions of packages'
17
+  'create:create a new formula'
18
+  'deps:list dependencies and dependants of a formula'
19
+  'doctor:audits your installation for common issues'
20
+  'edit:edit a formula'
21
+  'home:visit the homepage of a formula or the brew project'
22
+  'info:information about a formula'
23
+  'install:install a formula'
24
+  'link:link a formula'
25
+  'list:list files in a formula or not-installed formulae'
26
+  'log:git commit log for a formula'
27
+  'outdated:list formulas for which a newer version is available'
28
+  'prune:remove dead links'
29
+  'remove:remove a formula'
30
+  'search:search for a formula (/regex/ or string)'
31
+  'unlink:unlink a formula'
32
+  'update:freshen up links'
33
+  'uses:show formulas which depend on a formula'
34
+)
35
+
36
+local expl
37
+local -a formula installed_formulae
38
+
39
+_arguments \
40
+  '(-v --verbose)'{-v,--verbose}'[verbose]' \
41
+  '(--version)--version[version information]' \
42
+  '(--prefix)--prefix[where brew lives on this system]' \
43
+  '(--cache)--cache[brew cache]' \
44
+  '*:: :->subcmds' && return 0
45
+
46
+if (( CURRENT == 1 )); then
47
+  _describe -t commands "brew subcommand" _1st_arguments
48
+  return
49
+fi
50
+
51
+case "$words[1]" in
52
+  list)
53
+    _arguments \
54
+      '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
55
+      '1: :->forms' &&  return 0
56
+
57
+      if [[ "$state" == forms ]]; then
58
+        _brew_installed_formulae
59
+        _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
60
+      fi ;;
61
+  install|home|log|info|uses|cat|deps)
62
+    _brew_all_formulae
63
+    _wanted formulae expl 'all formulae' compadd -a formulae ;;
64
+  remove|edit|xo)
65
+    _brew_installed_formulae
66
+    _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
67
+esac
68
+
... ...
@@ -1,4 +1,4 @@
1 1
 # add brew completion function to path
2
-fpath=($ZSH/functions/brew $fpath)
2
+fpath=($ZSH/plugins/brew $fpath)
3 3
 autoload -U compinit
4 4
 compinit -i
5 5
deleted file mode 100644
... ...
@@ -1,4 +0,0 @@
1
-# add brew completion function to path
2
-fpath=($ZSH/functions/gem $fpath)
3
-autoload -U compinit
4
-compinit -i
5 1
new file mode 100644
... ...
@@ -0,0 +1,64 @@
0
+#compdef gem
1
+#autoload
2
+
3
+# gem zsh completion, based on homebrew completion
4
+
5
+_gem_installed() {
6
+  installed_gems=(`gem list --local --no-versions`)
7
+}
8
+
9
+local -a _1st_arguments
10
+_1st_arguments=(
11
+  'cert:Manage RubyGems certificates and signing settings'
12
+  'check:Check installed gems'
13
+  'cleanup:Clean up old versions of installed gems in the local repository'
14
+  'contents:Display the contents of the installed gems'
15
+  'dependency:Show the dependencies of an installed gem'
16
+  'environment:Display information about the RubyGems environment'
17
+  'fetch:Download a gem and place it in the current directory'
18
+  'generate_index:Generates the index files for a gem server directory'
19
+  'help:Provide help on the `gem` command'
20
+  'install:Install a gem into the local repository'
21
+  'list:Display gems whose name starts with STRING'
22
+  'lock:Generate a lockdown list of gems'
23
+  'mirror:Mirror a gem repository'
24
+  'outdated:Display all gems that need updates'
25
+  'owner:Manage gem owners on RubyGems.org.'
26
+  'pristine:Restores installed gems to pristine condition from files located in the gem cache'
27
+  'push:Push a gem up to RubyGems.org'
28
+  'query:Query gem information in local or remote repositories'
29
+  'rdoc:Generates RDoc for pre-installed gems'
30
+  'search:Display all gems whose name contains STRING'
31
+  'server:Documentation and gem repository HTTP server'
32
+  'sources:Manage the sources and cache file RubyGems uses to search for gems'
33
+  'specification:Display gem specification (in yaml)'
34
+  'stale:List gems along with access times'
35
+  'uninstall:Uninstall gems from the local repository'
36
+  'unpack:Unpack an installed gem to the current directory'
37
+  'update:Update the named gems (or all installed gems) in the local repository'
38
+  'which:Find the location of a library file you can require'
39
+)
40
+
41
+local expl
42
+local -a gems installed_gems
43
+
44
+_arguments \
45
+  '(-v --version)'{-v,--version}'[show version]' \
46
+  '(-h --help)'{-h,--help}'[show help]' \
47
+  '*:: :->subcmds' && return 0
48
+
49
+if (( CURRENT == 1 )); then
50
+  _describe -t commands "gem subcommand" _1st_arguments
51
+  return
52
+fi
53
+
54
+case "$words[1]" in
55
+  list)
56
+      if [[ "$state" == forms ]]; then
57
+        _gem_installed
58
+        _requested installed_gems expl 'installed gems' compadd -a installed_gems
59
+      fi ;;
60
+  uninstall|update)
61
+    _gem_installed
62
+    _wanted installed_gems expl 'installed gems' compadd -a installed_gems ;;
63
+esac
0 64
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+# add brew completion function to path
1
+fpath=($ZSH/plugins/gem $fpath)
2
+autoload -U compinit
3
+compinit -i
0 4
deleted file mode 100644
... ...
@@ -1,4 +0,0 @@
1
-# add brew completion function to path
2
-fpath=($ZSH/functions/pip $fpath)
3
-autoload -U compinit
4
-compinit -i
5 1
new file mode 100644
... ...
@@ -0,0 +1,46 @@
0
+#compdef pip
1
+#autoload
2
+
3
+# pip zsh completion, based on homebrew completion
4
+
5
+_pip_installed() {
6
+  installed_pkgs=(`pip freeze`)
7
+}
8
+
9
+local -a _1st_arguments
10
+_1st_arguments=(
11
+  'bundle:Create pybundles (archives containing multiple packages)'
12
+  'freeze:Output all currently installed packages (exact versions) to stdout'
13
+  'help:Show available commands'
14
+  'install:Install packages'
15
+  'search:Search PyPI'
16
+  'uninstall:Uninstall packages'
17
+  'unzip:Unzip individual packages'
18
+  'zip:Zip individual packages'
19
+)
20
+
21
+local expl
22
+local -a pkgs installed_pkgs
23
+
24
+_arguments \
25
+  '(--version)--version[Show version number of program and exit]' \
26
+  '(-v --verbose)'{-v,--verbose}'[Give more output]' \
27
+  '(-q --quiet)'{-q,--quiet}'[Give less output]' \
28
+  '(-h --help)'{-h,--help}'[Show help]' \
29
+  '*:: :->subcmds' && return 0
30
+
31
+if (( CURRENT == 1 )); then
32
+  _describe -t commands "pip subcommand" _1st_arguments
33
+  return
34
+fi
35
+
36
+case "$words[1]" in
37
+  list)
38
+      if [[ "$state" == forms ]]; then
39
+        _pip_installed
40
+        _requested installed_pkgs expl 'installed packages' compadd -a installed_pkgs
41
+      fi ;;
42
+  uninstall)
43
+    _pip_installed
44
+    _wanted installed_pkgs expl 'installed packages' compadd -a installed_pkgs ;;
45
+esac
0 46
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+# add brew completion function to path
1
+fpath=($ZSH/plugins/pip $fpath)
2
+autoload -U compinit
3
+compinit -i