def _para_list(self, params, part): l = len(params) if l == 0: return suggest(self._children.keys(), part) if l == 1: return suggest(['all', 'enabled', 'disabled'], part) return []
def suggest_params(self, command, params, part): if command in self.get_commands(): return menu.suggest_params(self, command, params, part) alreadySel = [s.lstrip('!') for s in [command] + params] plugins = self._plugins.keys() return suggest(plugins, part.lstrip('!'), alreadySel)
def _para_details(self, params, part): if len(params): return [] all_edata = self._w3af.exception_handler.get_all_exceptions() suggestions = [str(i) for i in xrange(len(all_edata))] return suggest(suggestions, part)
def suggest_commands(self, part='', onlyLocal=False): first, rest = splitPath(part) if rest is None: # the command must be in the current menu result = suggest(self.get_commands(onlyLocal), part) if self.get_children() is not None: result += suggest(self.get_children(), part) return result else: try: # delegate to the children subMenu = self.get_children()[first] return subMenu.suggest_commands(rest, True) except: return []
def _para_set(self, params, part): if len(params) == 0: result = suggest([i.get_name() for i in self._options], part) return result elif len(params) == 1: paramName = params[0] if paramName not in self._options: return [] opt = self._options[paramName] paramType = opt.get_type() if paramType == 'boolean': values = [opt.get_default_value( ) == 'True' and 'False' or 'True'] else: values = self._memory[paramName] return suggest(values, part) else: return []
def _para_set(self, params, part): if len(params) == 0: result = suggest([i.get_name() for i in self._options], part) return result elif len(params) == 1: paramName = params[0] if paramName not in self._options: return [] opt = self._options[paramName] paramType = opt.get_type() if paramType == 'boolean': values = [ opt.get_default_value() == 'True' and 'False' or 'True' ] else: values = self._memory[paramName] return suggest(values, part) else: return []
def _para_add(self, params, part): if len(params): return [] return suggest(get_template_names(), part)
def _para_list(self, params, part): if len(params): return [] return suggest(self._w3af.plugins.get_plugin_types(), part)
def _para_list(self, params, part=''): if len(params) == 0: return suggest(['enabled', 'all', 'disabled'], part) return []
def _para_config(self, params, part): if len(params) > 0: return [] return suggest([p for p in self._plugins.keys() if self._plugins[p] > 0], part)
def _para_list(self, params, part): if len(params): return [] return suggest(self.__getters.keys(), part)
def _para_help(self, params, part): if len(params) == 0: return suggest(self._help.get_items(), part) else: return []
def _para_config(self, params, part): if len(params) > 0: return [] return suggest( [p for p in self._plugins.keys() if self._plugins[p] > 0], part)
def _para_desc(self, params, part): if len(params) > 0: return [] return suggest(self._plugins.keys(), part)
def _para_use(self, params, part): if not params: return suggest(self._profiles.keys(), part) return []
def suggest_commands(self, part, *skip): return suggest(self._plugins.keys() + ['all'], part.lstrip('!')) + \ suggest(self.get_commands(), part)
def _para_help(self, params, part): result = menu._para_help(self, params, part) result.extend(suggest(self._optDict, part)) return result