def create_parser()

in tools/heron/graph_builder.py [0:0]


def create_parser() -> argparse.ArgumentParser:
    """ Helper function for creating the command line arguments parser. """

    parser = argparse.ArgumentParser(
        description=("Builds a physical graph representation of the specified"
                     "heron topology "))
    parser.add_argument("-cfg", "--config", required=True,
                        help="Path to the configuration file containing the "
                             "graph and metrics database strings and the url "
                             "to the Heron Tracker.")
    parser.add_argument("-t", "--topology", required=True,
                        help="The topology identification string")
    parser.add_argument("-z", "--zone", required=True,
                        help="The zone the topology is run within")
    parser.add_argument("-e", "--environment", required=True,
                        help=("The environment the topology is run within. "
                              "eg TEST, PROD etc."))
    parser.add_argument("-r", "--reference", required=True,
                        help=("The topology reference to be applied to all "
                              "elements of the physical graph."))
    parser.add_argument("-p", "--populate", required=False,
                        action="store_true",
                        help=("Flag indicating if the physical graph should "
                              "be populated with metrics. This requires some "
                              "custom caladrius metric classes to be included "
                              "in the topology."))
    parser.add_argument("-d", "--duration", type=int, required=False,
                        help=("The time in second from now backwards over "
                              "which metrics should be gathered."))
    parser.add_argument("--debug", required=False, action="store_true",
                        help=("Optional flag indicating if debug logging "
                              "output should be shown"))
    parser.add_argument("-q", "--quiet", required=False, action="store_true",
                        help=("Optional flag indicating if log output should "
                              "be suppressed."))
    return parser