update 0.5

This commit is contained in:
utahta
2010-11-13 03:25:56 +09:00
parent 640fb13834
commit 3f455e161b
26 changed files with 969 additions and 1423 deletions
+27
View File
@@ -0,0 +1,27 @@
from pythonbrew.basecommand import Command, command_dict
from pythonbrew.baseparser import parser
from pythonbrew.log import logger
class HelpCommand(Command):
name = "help"
usage = "%prog [COMMAND]"
summary = "Show available commands"
def run_command(self, options, args):
if args:
command = args[0]
if command not in command_dict:
parser.error("Unknown command: `%s`" % command)
return
command = command_dict[command]
command.parser.print_help()
return
parser.print_help()
logger.info("\nCommands available:")
commands = [command_dict[key] for key in sorted(command_dict.keys())]
for command in commands:
logger.info(" %s: %s" % (command.name, command.summary))
logger.info("\nFurther Instructions:")
logger.info(" http://github.com/utahta/pythonbrew")
HelpCommand()