def METHOD_NAME(args):
    """
    Handles the command line arguments
    args is the list of arguments passed
    return (int): value to return to the OS as program exit code
    """
    # arguments handling
    parser = argparse.ArgumentParser()
    parser.add_argument("--wavelength", dest="wavelength", type=float,
                        required=True,
                        help="Centre wavelength (in nm) of the excitation light to use.")
    parser.add_argument("--power", dest="power", type=float,
                        help="Excitation light power (in W), default is maximum.")
    parser.add_argument("--number", dest="number", type=int, required=True,
                        help="Number of frames to grab.")
    # TODO: specify the folder name where to save the file
    parser.add_argument("--output", "-o", dest="output",
                        help="template of the filename under which to save the images. "
                        "The file format is derived from the extension "
                        "(TIFF and HDF5 are supported).")
    options = parser.parse_args(args[1:])
    try:
        acquirer = HRAcquirer(options.output, options.number)
        acquirer.set_hardware_settings(options.wavelength * 1e-9, options.power)
        acquirer.acquire()
    except ValueError as exp:
        logging.error("%s", exp)
        return 127
    except IOError as exp:
        logging.error("%s", exp)
        return 129
    except Exception:
        logging.exception("Unexpected error while performing action.")
        return 130
    return 0