• 
      

    rbtools commands improvements

    Review Request #3726 — Created Jan. 6, 2013 and submitted — Latest diff uploaded

    Information

    RBTools
    api

    Reviewers

    Has parent review request /r/3727
    
    Add initial command help
    
    'rbt help' can now be called to display a list of commands and usage
    text. 'rbt help <command>' will output the help specific to a command
    including the options it takes. Formatting and the  extensiveness of
    help for each command will be improved in the future, but this is a
    good start.
    
    Add checking for number of command args
    
    The number of args provided to the command is now checked against the
    number the command accepts (based on the signature of its main
    method). Usage text and an error are now displayed if the number of
    arguments provided is invalid.
    
    Add proper usage text to commands
    
    Commands may now define 'args' which will be output with usage text to
    show the arguments a command takes. Commands now have a 'usage' method
    which will return the usage text. While this can be overridden, the
    base class 'usage' should generally suffice.
    
    Introduce a new class for defining options
    
    A new 'Option' has been added which allows specifying a 'config_key'.
    The provided 'config_key' will be used to retrieve a default value for
    the option from the configuration files. This will take precedence
    over the value provided for 'default'. This should also allow us to
    provide the corresponding config file option when displaying help.
    
    Additionally, all of the current commands have been switched over to
    the new method for defining options, and the parsing code has been
    changed accordingly.
    
    Add missing imports and fix small bug
    
    A couple imports were missing, and a object attribute was being
    accessed without "self." prepended.
    
    Change command author to The Review Board Project
    
    A number of the commands built as part of the core rbtools were using
    individual authors. In order to be clear these commands are developed
    as part of the core project, the author has been changed.
    Ran commands. Output help for commands. Checked commands with invalid number of arguments.