softlayer/softlayer-api-python-client — pull request #29 by sudorandom (2013-02-09 03:57:03+00:00)
Title: Some CLI Cleanup/Housekeeping

This pull request is to make things a bit nicer. For example:

$ sl
usage: sl {help,list,cci,dns,firewall,list}
sl: error: too few arguments

is now:

$ sl
usage: sl [--format {table,raw}] [{help,list,cci,dns,firewall,list}]

SoftLayer Command-line Client

positional arguments:
{help,list,cci,dns,firewall,list}
Module name, try help or list

optional arguments:
--format {table,raw} output format

Detail:

* CLI: creates add_really_argument() helper for CLIRunnables to use
* CLI: moves loading/getting modules to CCI/__init__.py for reuse
* CLI: Adds 'list' CLIRunnable which lists all available commands
* CLI: Adds execute() convention for CLI modules. If the function exists in a CLI module it will use execute() when evoking 'sl module_name'
* CLI: When there are no CLIRunnables in a CLI module, do not add the subparser. This prevents ugly output (mostly for `sl list`).
* CLI: `sl` no longer outputs an error saying you didn't provide enough arguments. Instead, it prints the help.
* CLI: Adds 'importlib' as a requirement for Pythons < 2.7