(self,
option_strings,
dest,
default=None,
required=False,
help=None,
deprecated=False)
| 922 | |
| 923 | class BooleanOptionalAction(Action): |
| 924 | def __init__(self, |
| 925 | option_strings, |
| 926 | dest, |
| 927 | default=None, |
| 928 | required=False, |
| 929 | help=None, |
| 930 | deprecated=False): |
| 931 | |
| 932 | _option_strings = [] |
| 933 | for option_string in option_strings: |
| 934 | _option_strings.append(option_string) |
| 935 | |
| 936 | if option_string.startswith('--'): |
| 937 | if option_string.startswith('--no-'): |
| 938 | raise ValueError(f'invalid option name {option_string!r} ' |
| 939 | f'for BooleanOptionalAction') |
| 940 | option_string = '--no-' + option_string[2:] |
| 941 | _option_strings.append(option_string) |
| 942 | |
| 943 | super().__init__( |
| 944 | option_strings=_option_strings, |
| 945 | dest=dest, |
| 946 | nargs=0, |
| 947 | default=default, |
| 948 | required=required, |
| 949 | help=help, |
| 950 | deprecated=deprecated) |
| 951 | |
| 952 | |
| 953 | def __call__(self, parser, namespace, values, option_string=None): |
nothing calls this directly
no test coverage detected