Checks the arguments and options.

    :param args: an object containing the options of the program.

    :type args: argparse.Namespace

    :returns: ``True`` if everything was OK.

    If there is a problem with an option, an exception is raised using the
    :py:class:`ProgramError` class, a message is printed to the
    :class:`sys.stderr` and the program exists with code 1.

def checkArgs(args):
    """Checks the arguments and options.

    :param args: an object containing the options of the program.

    :type args: argparse.Namespace

    :returns: ``True`` if everything was OK.

    If there is a problem with an option, an exception is raised using the
    :py:class:`ProgramError` class, a message is printed to the
    :class:`sys.stderr` and the program exists with code 1.

    """
    # Checking the input file
    if not os.path.isfile(args.problematic_samples):
        msg = "{}: no such file".format(args.problematic_samples)
        raise ProgramError(msg)

    # Checking the raw directory
    if not os.path.isdir(args.raw_dir):
        msg = "{}: no such directory".format(args.raw_dir)
        raise ProgramError(msg)

    # Checking the DPI value
    if args.dpi < 10:
        msg = "{}: DPI too low".format(args.dpi)
        raise ProgramError(msg)

    return True