def _help(command): """ :param command: the command name for which you want to see a help :type command: str :returns: process return code :rtype: int """ if command is not None: _help_command(command) else: logger.debug("DCOS bin path: {!r}".format(util.dcos_bin_path())) results = [(c, default_command_info(c)) for c in subcommand.default_subcommands()] paths = subcommand.list_paths() with ThreadPoolExecutor(max_workers=max(len(paths), 1)) as executor: results += list(executor.map(subcommand.documentation, paths)) commands_message = options\ .make_command_summary_string(sorted(results)) emitter.publish( "Command line utility for the Mesosphere Datacenter Operating\n" "System (DC/OS). The Mesosphere DC/OS is a distributed operating\n" "system built around Apache Mesos. This utility provides tools\n" "for easy management of a DC/OS installation.\n") emitter.publish("Available DC/OS commands:") emitter.publish(commands_message) emitter.publish( "\nGet detailed command description with 'dcos <command> --help'.") return 0
def _help(show_info): if show_info: emitter.publish(__doc__.split('\n')[0]) return 0 directory = util.dcos_path() logger.debug("DCOS Path: {!r}".format(directory)) paths = subcommand.list_paths() with ThreadPoolExecutor(max_workers=len(paths)) as executor: results = executor.map(subcommand.documentation, paths) commands_message = options.make_command_summary_string(sorted(results)) emitter.publish( "Command line utility for the Mesosphere Datacenter Operating\n" "System (DCOS). The Mesosphere DCOS is a distributed operating\n" "system built around Apache Mesos. This utility provides tools\n" "for easy management of a DCOS installation.\n") emitter.publish("Available DCOS commands:") emitter.publish(commands_message) emitter.publish( "\nGet detailed command description with 'dcos <command> --help'.") return 0