| 186 | return opts |
| 187 | |
| 188 | class CmdLineApp(Cmd): |
| 189 | |
| 190 | def do_ping(self, arg, opts=None): |
| 191 | print "pong" |
| 192 | |
| 193 | def do_conf(self, arg, opts=None): |
| 194 | pp(gdata["conf_data"]) |
| 195 | |
| 196 | def do_gdata(self, arg, opts=None): |
| 197 | pp(gdata) |
| 198 | |
| 199 | def do_db(self, arg, opts=None): |
| 200 | command_data = { |
| 201 | 'zkdetails' : {'zkroot': gdata['conf_data']['zkroot'], 'zk_client': gdata['zk_client']}, |
| 202 | 'help_formatting' : gdata["help_formatting"], |
| 203 | } |
| 204 | cmd_db.cmd_db(arg, command_data) |
| 205 | |
| 206 | def complete_db(self, text, line, start_index, end_index): |
| 207 | help_cmd_strs_list = cmd_db.gdata["help_cmd_strs_list"] |
| 208 | return completions_helper(help_cmd_strs_list, text, line) |
| 209 | |
| 210 | def do_memcached(self, arg, opts=None): |
| 211 | command_data = { |
| 212 | 'zkdetails' : {'zkroot': gdata['conf_data']['zkroot'], 'zk_client': gdata['zk_client']}, |
| 213 | 'help_formatting' : gdata["help_formatting"], |
| 214 | } |
| 215 | cmd_memcached.cmd_memcached(arg, command_data) |
| 216 | |
| 217 | def complete_memcached(self, text, line, start_index, end_index): |
| 218 | help_cmd_strs_list = cmd_memcached.gdata["help_cmd_strs_list"] |
| 219 | return completions_helper(help_cmd_strs_list, text, line) |
| 220 | |
| 221 | def do_client(self, arg, opts=None): |
| 222 | command_data = { |
| 223 | 'zkdetails' : {'zkroot': gdata['conf_data']['zkroot'], 'zk_client': gdata['zk_client']}, |
| 224 | 'help_formatting' : gdata["help_formatting"], |
| 225 | } |
| 226 | cmd_client.cmd_client(arg, command_data) |
| 227 | |
| 228 | def complete_client(self, text, line, start_index, end_index): |
| 229 | help_cmd_strs_list = cmd_client.gdata["help_cmd_strs_list"] |
| 230 | return completions_helper(help_cmd_strs_list, text, line) |
| 231 | |
| 232 | def do_alg(self, arg, opts=None): |
| 233 | command_data = { |
| 234 | 'zkdetails' : {'zkroot': gdata['conf_data']['zkroot'], 'zk_client': gdata['zk_client']}, |
| 235 | 'default_algorithms' : gdata['conf_data']['default_algorithms'], |
| 236 | 'help_formatting' : gdata["help_formatting"], |
| 237 | } |
| 238 | cmd_alg.cmd_alg(arg, command_data) |
| 239 | |
| 240 | def complete_alg(self, text, line, start_index, end_index): |
| 241 | help_cmd_strs_list = cmd_alg.gdata["help_cmd_strs_list"] |
| 242 | return completions_helper(help_cmd_strs_list, text, line) |
| 243 | |
| 244 | def do_attr(self, arg, opts=None): |
| 245 | command_data = { |