parameters: (self, text, state)
docstring: Returns tab-completion hints. See the python documentation of the
          readline and Cmd modules for more information.
  
          The first time this is called (within one 'completer' action), it
          has state 0, and a list of possible completions is made. This list
          is stored; complete() will then be called with increasing values of
          state, until it returns None. For each call it returns the state'th
          element of the hints it collected in the first call.
  
          The hints list contents depend on which part of the full command
          line; if no module is given yet, it will list all modules. If a
          module is given, but no command, it will complete with module
          commands. If both have been given, it will create the hints based on
          the command parameters.
  
          If module and command have already been specified, and the command
          has a parameter 'identifier', the configuration data is used to
          create the hints list.
  
          Parameters:
          text (string): The text entered so far in the 'current' part of
                         the command (module, command, parameters)
          state (int): state used in the readline tab-completion logic;
                       0 on first call, increasing by one until there are
                       no (more) hints to return.
  
          Returns the string value of the hints list with index 'state',
          or None if no (more) hints are available.
docstring_summary: Returns tab-completion hints. See the python documentation of the
          readline and Cmd modules for more information.
docstring_tokens: Returns tab - completion hints . See the python documentation of the readline and Cmd modules for more information .
function: def complete(self, text, state):
          """
          Returns tab-completion hints. See the python documentation of the
          readline and Cmd modules for more information.
  
          The first time this is called (within one 'completer' action), it
          has state 0, and a list of possible completions is made. This list
          is stored; complete() will then be called with increasing values of
          state, until it returns None. For each call it returns the state'th
          element of the hints it collected in the first call.
  
          The hints list contents depend on which part of the full command
          line; if no module is given yet, it will list all modules. If a
          module is given, but no command, it will complete with module
          commands. If both have been given, it will create the hints based on
          the command parameters.
  
          If module and command have already been specified, and the command
          has a parameter 'identifier', the configuration data is used to
          create the hints list.
  
          Parameters:
          text (string): The text entered so far in the 'current' part of
                         the command (module, command, parameters)
          state (int): state used in the readline tab-completion logic;
                       0 on first call, increasing by one until there are
                       no (more) hints to return.
  
          Returns the string value of the hints list with index 'state',
          or None if no (more) hints are available.
          """
          if state == 0:
              self._update_all_modules_info()
              text = text.strip()
              hints = []
              cur_line = my_readline()
              try:
                  cmd = BindCmdParser(cur_line)
                  if not cmd.params and text:
                      hints = self._get_command_startswith(cmd.module, text)
                  elif self._cmd_has_identifier_param(cmd):
                      # If the command has an argument that is a configuration
                      # identifier (currently, this is only a subset of
                      # the config commands), then don't tab-complete with
                      # hints derived from command parameters, but from
                      # possible configuration identifiers.
                      #
                      # This solves the issue reported in #2254, where
                      # there were hints such as 'argument' and 'identifier'.
                      #
                      # Since they are replaced, the tab-completion no longer
                      # adds 'help' as an option (but it still works)
                      #
                      # Also, currently, tab-completion does not work
                      # together with 'config go' (it does not take 'current
                      # position' into account). But config go currently has
                      # problems by itself, unrelated to completion.
                      hints = self._get_identifier_startswith(text)
                  else:
                      hints = self._get_param_startswith(cmd.module, cmd.command,
                                                         text)
  
              except CmdModuleNameFormatError:
                  if not text:
                      hints = self.get_module_names()
  
              except CmdMissCommandNameFormatError as e:
                  if not text.strip(): # command name is empty
                      hints = self.modules[e.module].get_command_names()
                  else:
                      hints = self._get_module_startswith(text)
  
              except CmdCommandNameFormatError as e:
                  if e.module in self.modules:
                      hints = self._get_command_startswith(e.module, text)
  
              except CmdParamFormatError as e:
                  hints = self._get_param_startswith(e.module, e.command, text)
  
              except BindCtlException:
                  hints = []
  
              self.hint = hints
  
          if state < len(self.hint):
              return self.hint[state]
          else:
              return None
function_tokens: def complete ( self , text , state ) : if state == 0 : self . _update_all_modules_info ( ) text = text . strip ( ) hints = [ ] cur_line = my_readline ( ) try : cmd = BindCmdParser ( cur_line ) if not cmd . params and text : hints = self . _get_command_startswith ( cmd . module , text ) elif self . _cmd_has_identifier_param ( cmd ) : # If the command has an argument that is a configuration # identifier (currently, this is only a subset of # the config commands), then don't tab-complete with # hints derived from command parameters, but from # possible configuration identifiers. # # This solves the issue reported in #2254, where # there were hints such as 'argument' and 'identifier'. # # Since they are replaced, the tab-completion no longer # adds 'help' as an option (but it still works) # # Also, currently, tab-completion does not work # together with 'config go' (it does not take 'current # position' into account). But config go currently has # problems by itself, unrelated to completion. hints = self . _get_identifier_startswith ( text ) else : hints = self . _get_param_startswith ( cmd . module , cmd . command , text ) except CmdModuleNameFormatError : if not text : hints = self . get_module_names ( ) except CmdMissCommandNameFormatError as e : if not text . strip ( ) : # command name is empty hints = self . modules [ e . module ] . get_command_names ( ) else : hints = self . _get_module_startswith ( text ) except CmdCommandNameFormatError as e : if e . module in self . modules : hints = self . _get_command_startswith ( e . module , text ) except CmdParamFormatError as e : hints = self . _get_param_startswith ( e . module , e . command , text ) except BindCtlException : hints = [ ] self . hint = hints if state < len ( self . hint ) : return self . hint [ state ] else : return None