tools/site_compare/command_line.py
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
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
    
Add a new command to the parser.
Add a new command to the parser .
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
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
Add a new command to the parser.
Add a new command to the parser .
"""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
    """
The new command
The new command
raised if command already added
raised if command already added
ValueError
self
names
command name, or list of synonyms
command name or list of synonyms
helptext
brief string description of the command
brief string description of the command
validator
method to validate a command's arguments
method to validate a command ' s arguments
impl
callable to be invoked when command is called
callable to be invoked when command is called