1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| parent_parser = argparse.ArgumentParser()
parent_parser.add_argument("-u", "--url", dest="url", help="sa url") parent_parser.add_argument("-p", "--project", dest="project", help=" project name") parent_parser.add_argument("-t", "--token", dest="token", help="token,API secret")
sub_parser = parent_parser.add_subparsers(dest="subparsers_name")
trigger_parser = sub_parser.add_parser("trigger", help="trigger tag calculate", parents=[parent_parser], add_help=False) trigger_parser.add_argument("-d", "--etl_date", dest="etl_date", help="source data etl_date", required=True) trigger_parser.add_argument("-e", "--event", dest="event", help="the tag that relation events", required=True)
delete_parser = sub_parser.add_parser("delete", help="delete tag", parents=[parent_parser], add_help=False) delete_parser.add_argument("-fd", "--from_date", dest="from_date", help="delete start date", required=True) delete_parser.add_argument("-td", "--to_date", dest="to_date", help="delete end date", required=True) delete_parser.add_argument("-i", "--tag_id", dest="tag_id", help="delete tag id", required=False) delete_parser.add_argument("-f", "--tag_config", dest="tag_config", help="delete tag id file", required=False)
args = parent_parser.parse_args()
|