in python-threatexchange/threatexchange/cli/dataset_cmd.py [0:0]
def init_argparse(cls, settings: CLISettings, ap: ArgumentParser) -> None:
actions = ap.add_mutually_exclusive_group()
actions.add_argument(
"--rebuild-indices",
"-r",
action="store_true",
help="rebuild indices from fetched data",
)
actions.add_argument(
"--clear-indices",
"-X",
action="store_true",
help="clear all indices",
)
actions.add_argument(
"--signal-summary",
"-S",
action="store_true",
help="print summary in terms of signals",
)
actions.add_argument(
"--print-records",
"-P",
action="store_true",
help="print records to screen",
)
type_selector = ap.add_mutually_exclusive_group()
type_selector.add_argument(
"--only-signals",
"-s",
nargs="+",
default=[],
type=common.argparse_choices_pre_type(
choices=[s.get_name() for s in settings.get_all_signal_types()],
type=settings.get_signal_type,
),
help="only process these sigals",
)
type_selector.add_argument(
"--only-content",
"-C",
nargs="+",
default=[],
type=common.argparse_choices_pre_type(
choices=[s.get_name() for s in settings.get_all_content_types()],
type=settings.get_content_type,
),
help="only process signals for these content types",
)
ap.add_argument(
"--only-collabs",
"-c",
nargs="+",
default=[],
metavar="NAME",
help="[-S|-P] only count items with this tag",
)
ap.add_argument(
"--only-tags",
"-t",
default=[],
metavar="STR",
help="[-S|-P] only count items with these tags",
)
ap.add_argument(
"--signals-only",
"-i",
action="store_true",
help="[-P] only print signals",
)
ap.add_argument(
"--limit",
"-l",
action="store_true",
help="[-P] only print this many records",
)