We'd like to use ekeyword in a git merge driver implementation (see https://archives.gentoo.org/gentoo-portage-dev/message/ddf7e0285b28ac044e5da7e5ce4fec47), but the files that the driver will pass to ekeyword do not necessarily have a .ebuild suffix. Therefore, it would be handy to be able to distinguish ebuild arguments some other way. Perhaps os.path.isfile(arg) would be sufficient.
Patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/f5db6298065678fbd68b16eb9c0cb060 https://github.com/gentoo/gentoolkit/pull/13
Looks good to me. Go ahead from me.
FWIW, our git merge driver could potentially bypass the argument parsing logic like this: try: ekeyword.process_ebuild(pathname, list(map(ekeyword.arg_to_op, args)) except Exception: result = 1 traceback.print_exc() else: result = 0