brintos

brintos / llvm-project-archived public Read only

0
0
Text · 749 B · dea26f1 Raw
23 lines · python
1# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.2# See https://llvm.org/LICENSE.txt for license information.3# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception4"""Library functions for setting up common parser arguments"""5 6from argparse import ArgumentParser7 8 9def add_verbosity_arguments(parser: ArgumentParser) -> None:10    """Adds the arguments for verbosity to the ArgumentParser11 12    Arguments:13        parser: The argument parser being modified with verbosity arguments.14    """15    parser.add_argument(16        "--verbosity",17        type=str,18        help="The verbosity level to use for logging",19        default="INFO",20        nargs="?",21        choices=["DEBUG", "INFO", "WARNING", "ERROR"],22    )23