Browse code

Moving brew functions to it's own plugin

Robby Russell authored on 03/06/2010 at 19:59:49
Showing 2 changed files
1 1
deleted file mode 100644
... ...
@@ -1,61 +0,0 @@
1
-#compdef brew
2
-
3
-# copied from _fink
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
-  'install:install a formula'
16
-  'remove:remove a formula'
17
-  'search:search for a formula (/regex/ or string)'
18
-  'list:list files in a formula or not-installed formulae'
19
-  'link:link a formula'
20
-  'unlink:unlink a formula'
21
-  'home:visit the homepage of a formula or the brew project'
22
-  'info:information about a formula'
23
-  'prune:remove dead links'
24
-  'update:freshen up links'
25
-  'log:git commit log for a formula'
26
-  'create:create a new formula'
27
-  'edit:edit a formula'
28
-)
29
-
30
-local expl
31
-local -a formula installed_formulae
32
-
33
-_arguments \
34
-  '(-v --verbose)'{-v,--verbose}'[verbose]' \
35
-  '(--version)--version[version information]' \
36
-  '(--prefix)--prefix[where brew lives on this system]' \
37
-  '(--cache)--cache[brew cache]' \
38
-  '*:: :->subcmds' && return 0
39
-
40
-if (( CURRENT == 1 )); then
41
-  _describe -t commands "brew subcommand" _1st_arguments
42
-  return
43
-fi
44
-
45
-case "$words[1]" in
46
-  list)
47
-    _arguments \
48
-      '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
49
-      '1: :->forms' &&  return 0
50
-      
51
-      if [[ "$state" == forms ]]; then
52
-        _brew_installed_formulae
53
-        _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
54
-      fi ;;
55
-  install|home|log|info)
56
-    _brew_all_formulae
57
-    _wanted formulae expl 'all formulae' compadd -a formulae ;;
58
-  remove|edit|xo)
59
-    _brew_installed_formulae
60
-    _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
61
-esac
62 1
new file mode 100644
... ...
@@ -0,0 +1,61 @@
0
+#compdef brew
1
+
2
+# copied from _fink
3
+
4
+_brew_all_formulae() {
5
+  formulae=(`brew search`)
6
+}
7
+
8
+_brew_installed_formulae() {
9
+  installed_formulae=(`brew list`)
10
+}
11
+
12
+local -a _1st_arguments
13
+_1st_arguments=(
14
+  'install:install a formula'
15
+  'remove:remove a formula'
16
+  'search:search for a formula (/regex/ or string)'
17
+  'list:list files in a formula or not-installed formulae'
18
+  'link:link a formula'
19
+  'unlink:unlink a formula'
20
+  'home:visit the homepage of a formula or the brew project'
21
+  'info:information about a formula'
22
+  'prune:remove dead links'
23
+  'update:freshen up links'
24
+  'log:git commit log for a formula'
25
+  'create:create a new formula'
26
+  'edit:edit a formula'
27
+)
28
+
29
+local expl
30
+local -a formula installed_formulae
31
+
32
+_arguments \
33
+  '(-v --verbose)'{-v,--verbose}'[verbose]' \
34
+  '(--version)--version[version information]' \
35
+  '(--prefix)--prefix[where brew lives on this system]' \
36
+  '(--cache)--cache[brew cache]' \
37
+  '*:: :->subcmds' && return 0
38
+
39
+if (( CURRENT == 1 )); then
40
+  _describe -t commands "brew subcommand" _1st_arguments
41
+  return
42
+fi
43
+
44
+case "$words[1]" in
45
+  list)
46
+    _arguments \
47
+      '(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
48
+      '1: :->forms' &&  return 0
49
+      
50
+      if [[ "$state" == forms ]]; then
51
+        _brew_installed_formulae
52
+        _requested installed_formulae expl 'installed formulae' compadd -a installed_formulae
53
+      fi ;;
54
+  install|home|log|info)
55
+    _brew_all_formulae
56
+    _wanted formulae expl 'all formulae' compadd -a formulae ;;
57
+  remove|edit|xo)
58
+    _brew_installed_formulae
59
+    _wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
60
+esac