class CapturableVersionAction(argparse.Action): (source)
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 |
Undocumented
Parameters | |
parser:argparse.ArgumentParser | Undocumented |
namespace:argparse.Namespace | Undocumented |
values:Union[ | Undocumented |
option_string:Optional[ | Undocumented |
Returns | |
NoReturn | Undocumented |
Undocumented
Parameters | |
option_strings:Sequence[ | Undocumented |
version:str | Undocumented |
dest:str | Undocumented |
default:str | Undocumented |
help:str | Undocumented |
stdout:Optional[ | Undocumented |