parameters: (self, names, helptext, validator=None, impl=None)
return_statement: return cmd
docstring: Add a new command to the parser.
  
      Args:
        names:       command name, or list of synonyms
        helptext:    brief string description of the command
        validator:   method to validate a command's arguments
        impl:        callable to be invoked when command is called
  
      Raises:
        ValueError: raised if command already added
  
      Returns:
        The new command
docstring_summary: Add a new command to the parser.
docstring_tokens: Add a new command to the parser .
function: def AddCommand(self, names, helptext, validator=None, impl=None):
      """Add a new command to the parser.
  
      Args:
        names:       command name, or list of synonyms
        helptext:    brief string description of the command
        validator:   method to validate a command's arguments
        impl:        callable to be invoked when command is called
  
      Raises:
        ValueError: raised if command already added
  
      Returns:
        The new command
      """
      if IsString(names): names = [names]
  
      for name in names:
        if name in self.cmd_dict:
          raise ValueError("%s is already a command"%name)
  
      cmd = Command(names, helptext, validator, impl)
      cmd.cmdline = self
  
      self.commands.append(cmd)
      for name in names:
        self.cmd_dict[name.lower()] = cmd
  
      return cmd
function_tokens: def AddCommand ( self , names , helptext , validator = None , impl = None ) : if IsString ( names ) : names = [ names ] for name in names : if name in self . cmd_dict : raise ValueError ( "%s is already a command" % name ) cmd = Command ( names , helptext , validator , impl ) cmd . cmdline = self self . commands . append ( cmd ) for name in names : self . cmd_dict [ name . lower ( ) ] = cmd return cmd