def help(script, name=None): """Returns information about commands.""" if name is None: commands = sorted([item.name for item in script.get_commands()]) return 'Commands: ' + ', '.join(commands) else: command = script.get_command(name) if command is None: return 'No such command' return command.get_help()
def help(script, name=None): if name is None: commands = [item.name for item in script.get_commands()] commands.sort() return 'Commands: ' + ', '.join(commands) else: command = script.get_command(name) if command is None: return 'No such command' return command.get_help()