def parse_arguments():
"""Parse and validate command-line arguments"""
parser = argparse.ArgumentParser(description="Justicier")
parser.add_argument("-r", "--request", "--id", type=parse_id, required=False,
help='ID of the justification request in Microsoft List of Peticions Justificacions. If you use'
' this argument you can\'t use any other argument to submit data to the algorithm except '
' for -l / --location ')
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, "input"),
help="Path location of input data. If used, --location local is assumed.")
parser.add_argument("-n", "--naf", "--NAF", type=parse_naf, required=False,
help="NAF (SS security number) of the employee to justify")
parser.add_argument("-N", "--name", type=parse_name_a3, required=False,
help="Name of the employee to justify")
parser.add_argument("-t", "--target-email", type=parse_email_a3, required=False,
help="Email of the employee to justify")
parser.add_argument("-d", "--dni", "--DNI", type=parse_dni, required=False,
help="Name of the employee to justify")
parser.add_argument("-b", "--begin", type=parse_date, required=False, help="Begin date (YYYY-MM-DD)")
parser.add_argument("-e", "--end", type=parse_date, required=False, help="End date (YYYY-MM-DD)")
parser.add_argument("-a", "--author", type=parse_author, required=False, help="author's email doing"
" request")
parser.add_argument("-s", "--merge-salary", type=parse_boolean, required=False, default=False,
help="Merge each salary with the corresponding bank proof")
parser.add_argument("-m", "--merge-result", type=parse_boolean, required=False,
default=get_compact_init(),
help="Comma separated list of values that indicate which documents need to be merged in one "
"single PDF in the output. Possible values are: " +
",".join([dt.value.__str__() for dt in DocType]))
parser.add_argument("-R", "--merge-rnt-rlc", type=parse_boolean, required=False, default=False,
help="Merge all RLCs and RNTs of each month.")
args = parser.parse_args()
return args