undo any command
Unco - undo any command
# record changes to files made by cmd % unco record -- cmd args
# display a list of recorded commands % unco history
# undo a recorded change % unco undo
# redo a recorded change % undo redo
Unco is a wrapper program that records the changes made to files by programs so that they can be undone laterwards.
It uses a technique called library preloading (for more information consult the linux documents with keyword LDPRELOAD, or os x document with keyword DYLDINSERT_LIBRARIES) to trap the library calls that affect the files, and records the changes made by the programs being executed.
cmake . make make install
=head2 unco record
% unco record [--log=] [--append] -- cmd args
The command executes given command while logging the changes.
specifies the location of the log (if omitted, the log is stored under $HOME/.unco with appropriate index)
used together with --log for appending the changes to the log (default behavior is truncate)
=head2 unco history
% unco history [--ppid=] [--cmd=] [--cwd=
Displays the list of recorded commands with their associated indices.
filters the output to commands that were spawned by given process id. If omitted, the default value is the process id that spawned the history command, so that only the records belonging to the current shell are being displayed. Set -1 as the argument to display all records.
filters the output to commands starting with given prefix
filters the output to commands that were spawn under given working directory
=head2 unco undo
% unco undo [--print]
Undoes a recorded change. The argument is the index number displayed by L or path pointing to a unco record.
displays the changes to be performed instead of actually applying them
=head2 unco redo
% unco redo [--print]
Redoes a recorded change that has been undone. The index is the number displayed by L or path pointing to a unco record.
Kazuho Oku Lhttps://github.com/kazuho/