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(description="Computes the distances travelled by each axis from a log file")
    parser.add_argument('input', default="-",
                        help='Input file name (default: -, which means stdin)')
    options = parser.parse_args(args[1:])
    try:
        inf = open_file(options.input)
        try:
            odo = add_distances(inf)
        finally:
            inf.close()
        # sorted_odo = OrderedDict(sorted(odo.items()))
        print("Distance: %s" % (odo,))
    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
    except KeyboardInterrupt:
        return 1
    return 0