Browse code

fixed formatting; dead code deleted

Fedyashev Nikita authored on 15/11/2010 at 19:56:01
Showing 1 changed files
... ...
@@ -5,134 +5,103 @@
5 5
 
6 6
 __task_list ()
7 7
 {
8
-  local expl
9
-  declare -a tasks
8
+    local expl
9
+    declare -a tasks
10 10
 
11
-  tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version)
11
+    tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version)
12 12
 
13
-  _wanted tasks expl 'help' compadd $tasks
13
+    _wanted tasks expl 'help' compadd $tasks
14 14
 }
15 15
 
16 16
 __box_list ()
17 17
 {
18
-  _wanted application expl 'hxlp' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g')
18
+    _wanted application expl 'command' compadd $(command ls -1 $HOME/.vagrant/boxes 2>/dev/null| sed -e 's/ /\\ /g')
19 19
 }
20 20
 
21 21
 __vagrant-box ()
22 22
 {
23
- local curcontext="$curcontext" state line
24
-        typeset -A opt_args
23
+    local curcontext="$curcontext" state line
24
+    typeset -A opt_args
25 25
 
26
-        _arguments -C \
27
-		':command:->command' \
28
-		'*::options:->options'
29
-
30
-        case $state in
31
-                (command)
32
-
33
-                       # local -a subcommands
34
-                       # subcommands=(
35
-                       #         'start:Start a new release branch'
36
-                       #         'finish:Finish a release branche.'
37
-                       #         'list:List all your release branches. (Alias to `git flow release`)'
38
-                       # )
39
-                       # _describe -t commands 'git flow release' subcommands
40
-                       # _arguments \
41
-                       # -v'[Verbose (more) output]'
42
-       _describe -t commands "gem subcommand" _box_arguments
43
-       return
44
-                ;;
45
-
46
-                (options)
47
-                        case $line[1] in
48
-
49
-                                (repackage)
50
-				       _arguments \
51
-						-F'[Fetch from origin before performing finish]' \
52
-						-r'[Rebase instead of merge]'\
53
-							':feature:__box_list' 
54
-
55
-
56
-
57
-                                ;;
58
-                        esac
59
-                ;;
60
-         esac
26
+    _arguments -C \
27
+        ':command:->command' \
28
+        '*::options:->options'
61 29
 
30
+   case $state in
31
+       (command)
32
+           _describe -t commands "gem subcommand" _box_arguments
33
+           return
34
+       ;;
35
+
36
+       (options)
37
+           case $line[1] in
38
+               (repackage|remove)
39
+                   _arguments \
40
+                       -F'[Fetch from origin before performing finish]' \
41
+                       -r'[Rebase instead of merge]'\
42
+                         ':feature:__box_list' 
43
+               ;;
44
+           esac
45
+       ;;
46
+    esac
62 47
 }
63 48
 
64 49
 local -a _1st_arguments
65 50
 _1st_arguments=(
66
-  'box:Box commands'
67
-  'destroy:Destroys the vagrant environment'
68
-  'halt:Halts the currently running vagrant environment'
69
-  'help:[TASK] Describe available tasks or one specific task'
70
-  'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
71
-  'package:Packages a vagrant environment for distribution'
72
-  'provision:Run the provisioner'
73
-  'reload:Reload the vagrant environment'
74
-  'resume:Resumes a suspend vagrant environment'
75
-  'ssh:SSH into the currently running environment'
76
-  'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.'
77
-  'status:Shows the status of the current Vagrant environment.'
78
-  'suspend:Suspends the currently running vagrant environment'
79
-  'up:Creates the vagrant environment'
80
-  'version:Prints the Vagrant version information'
51
+    'box:Box commands'
52
+    'destroy:Destroys the vagrant environment'
53
+    'halt:Halts the currently running vagrant environment'
54
+    'help:[TASK] Describe available tasks or one specific task'
55
+    'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
56
+    'package:Packages a vagrant environment for distribution'
57
+    'provision:Run the provisioner'
58
+    'reload:Reload the vagrant environment'
59
+    'resume:Resumes a suspend vagrant environment'
60
+    'ssh:SSH into the currently running environment'
61
+    'ssh_config:outputs .ssh/config valid syntax for connecting to this environment via ssh.'
62
+    'status:Shows the status of the current Vagrant environment.'
63
+    'suspend:Suspends the currently running vagrant environment'
64
+    'up:Creates the vagrant environment'
65
+    'version:Prints the Vagrant version information'
81 66
 )
82 67
 
83 68
 local -a _box_arguments
84 69
 _box_arguments=(
85
-  'add:NAME URI Add a box to the system'
86
-  'help:COMMAND Describe subcommands or one specific subcommand'
87
-  'list:Lists all installed boxes'
88
-  'remove:NAME Remove a box from the system'
89
-  'repackage:NAME Repackage an installed box into a `.box` file.'
70
+    'add:NAME URI Add a box to the system'
71
+    'help:COMMAND Describe subcommands or one specific subcommand'
72
+    'list:Lists all installed boxes'
73
+    'remove:NAME Remove a box from the system'
74
+    'repackage:NAME Repackage an installed box into a `.box` file.'
90 75
 )
91 76
 
92 77
 local expl
93 78
 local -a boxes installed_boxes
94 79
 
95
-#_arguments \
96
-#  '(-v --version)'{-v,--version}'[show version]' \
97
-#  '(-h --help)'{-h,--help}'[show help]' \
98
-#  '*:: :->subcmds' && return 0
99
-        local curcontext="$curcontext" state line
100
-        typeset -A opt_args
101
-
102
-  _arguments -C \
103
-        ':command:->command' \
104
-        '*::options:->options'
105
-
80
+local curcontext="$curcontext" state line
81
+typeset -A opt_args
106 82
 
83
+_arguments -C \
84
+    ':command:->command' \
85
+    '*::options:->options'
107 86
 
108 87
 
109
-#echo $state
110
-#echo -e "\n\n\n\n"
111
-#echo $line[1]
112
-
113 88
 case $state in
114
-
115 89
   (command)
116
-
117
-	  _describe -t commands "gem subcommand" _1st_arguments
118
-	  return
90
+      _describe -t commands "gem subcommand" _1st_arguments
91
+      return
119 92
   ;;
120 93
 
121 94
   (options)
122
-
123 95
     case $line[1] in
124
-
125 96
       (help)
126
-	       _arguments \
127
-			-F'[Fetch from origin before performing finish]' \
128
-			-r'[Rebase instead of merge]'\
129
-				':feature:__task_list' 
130
-
97
+         _arguments \
98
+             -F'[Fetch from origin before performing finish]' \
99
+             -r'[Rebase instead of merge]'\
100
+               ':feature:__task_list' 
131 101
       ;;
132 102
 
133 103
       (box)
134
-
135
-        __vagrant-box
104
+          __vagrant-box
136 105
       ;;
137 106
     esac
138 107
   ;;