Skip to content

arguments

arguments

parse_arguments

parse_arguments()

Parse and validate command-line arguments

Source code in source/src/justifactu/arguments.py
def parse_arguments():
    """Parse and validate command-line arguments"""
    parser = argparse.ArgumentParser(description="Justifactu")

    parser.add_argument(
        "-l",
        "--location",
        type=parse_input_type,
        required=False,
        default="sharepoint",
        help='Location of the input data. Possible values are: "sharepoint" to download from '
        'sharepoint location and "local" to use the local file system storage and read the input'
        " folder in the repository root folder.",
    )
    parser.add_argument(
        "-L",
        "--input-location",
        type=parse_input_location,
        required=False,
        default=os.path.join(
            ROOT_FOLDER,
            "service",
            "onedrive",
            "data",
            "Justificació Projectes",
            "Automatitzacio Vinculacio Pagaments",
            "_input",
        ),
        help="Path location of input data. If used, --location local is assumed.",
    )

    args = parser.parse_args()

    return args