Lua Patch |
|
This is a Lua implementation of the patch utility [1]. It only supports unified diffs (diff -u
).
A main motivation of this utility is to provide a platform-independent, easily deployable, and simple patch utility for LuaRocks [2].
For help:
./patch.lua --help
To patch current directory using patch file "mypatch":
./patch.lua < mypatch
This code is new should undergo further testing. Some of the style might be further improved as it was converted from Python.
Note: Those code in the direct port is fairly ugly. It is being largely rewritten. If you want it sooner, just ask.
(c) 2008 David Manura, Licensed under the same terms as Lua (MIT license). Code is heavilly based on the Python-based patch.py version 8.06-1, Copyright (c) 2008 rainforce.org, MIT License . See included LICENSE.txt file.
Note: the source reuses Lua optparse (CommandLineParsing) and EnhancedFileLines (DavidManura).
Related documentation and implementations on patch: