explore_command(cmd: List[str], flags: Iterable[str] = (['--help'], ['-h'], , ['--usage']), parent: Optional[aclimatise.model.Command] = None, max_depth: int = 2, try_subcommand_flags=True, executor: aclimatise.execution.Executor = <aclimatise.execution.local.LocalExecutor object>) → Optional[aclimatise.model.Command]¶
Given a command to start with, builds a model of this command and all its subcommands (if they exist). Use this if you know the command you want to parse, you don’t know which flags it responds to with help text, and you want to include subcommands.
parse_help(cmd: Collection[str], text: str, max_length=1000) → aclimatise.model.Command¶
Parse a string of help text into a Command. Use this if you already have run the executable and extracted the help text yourself
cmd – List of arguments used to generate this help text, e.g. [‘bwa’, ‘mem’]
text – The help text to parse
max_length – If the input text has more than this many lines, no attempt will be made to parse the file (as it’s too large, will likely take a long time, and there’s probably an underlying problem if this has happened). In this case, an empty Command will be returned