class documentation

class CapturableVersionAction(argparse.Action): (source)

View In Hierarchy

Supplement CapturableArgumentParser to handle --version.

This is nearly identical to argparse._VersionAction except, like CapturableArgumentParser, it allows output to be captured.

Another notable difference is that version is mandatory. This allows removing a line in __call__ that falls back to parser.version (which does not appear to exist).

Method __call__ Undocumented
Method __init__ Undocumented
Instance Variable stdout Undocumented
Instance Variable version Undocumented
def __call__(self, parser, namespace, values, option_string=None): (source)

Undocumented

Parameters
parser:argparse.ArgumentParserUndocumented
namespace:argparse.NamespaceUndocumented
values:Union[str, Sequence[Any], None]Undocumented
option​_string:Optional[str]Undocumented
Returns
NoReturnUndocumented
def __init__(self, option_strings, version, dest=argparse.SUPPRESS, default=argparse.SUPPRESS, help='show program\'s version number and exit', stdout=None): (source)

Undocumented

Parameters
option​_strings:Sequence[str]Undocumented
version:strUndocumented
dest:strUndocumented
default:strUndocumented
help:strUndocumented
stdout:Optional[IO[str]]Undocumented
stdout = (source)

Undocumented

version = (source)

Undocumented