#!/usr/bin/python3
+# © Copyright 2021-2022, Scott Gasch
+
"""Helpers for commandline argument parsing."""
import argparse
class ActionNoYes(argparse.Action):
- """An argparse Action that allows for commandline arguments like this:
+ """An argparse Action that allows for commandline arguments like this::
cfg.add_argument(
'--enable_the_thing',
help='Should we enable the thing?'
)
- This creates cmdline arguments:
+ This creates the following cmdline arguments::
--enable_the_thing
--no_enable_the_thing
+ These arguments can be used to indicate the inclusion or exclusion of
+ binary exclusive behaviors.
"""
+
def __init__(self, option_strings, dest, default=None, required=False, help=None):
if default is None:
msg = 'You must provide a default with Yes/No action'