introspect_argparse
Class info¶
🛈 DocStrings¶
get_info
¶
get_info(instance: ArgumentParser, command: str | None = None) -> CommandInfo
Return a CommandInfo object for command of given instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instance
|
ArgumentParser
|
A |
required |
command
|
str | None
|
The command to get info for. (also accepts dot notation for subcommands) |
None
|
Source code in src/clinspector/introspect/introspect_argparse.py
parse
¶
parse(
parser: ArgumentParser,
name: str | None = None,
help_text: str | None = None,
deprecated: bool = False,
) -> CommandInfo
Recursively parse an ArgumentParser instance and return a CommandInfo object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parser
|
ArgumentParser
|
The parser to inspect. |
required |
name
|
str | None
|
The command name (defaults to the parser's |
None
|
help_text
|
str | None
|
Help text used if the parser has no description (subparser help). |
None
|
deprecated
|
bool
|
Whether the command is marked as deprecated. |
False
|