REDO-WHICHDO(1)

NAME
redo-whichdo - print search paths for dofiles to build a redo target

SYNOPSIS
redo-whichdo target

DESCRIPTION
redo(1) is a tool for building files and for rebuilding them if any of their dependencies have changed. redo-whichdo prints all dofiles that redo(1) will look for to build the target. If the exit code of redo-whichdo indicates success, the last filename is the filename of the dofile that redo(1) will actually use to build the target.

redo-whichdo prints the filename for a dofile that redo(1) could use to build the target. If the dofile exists, redo-whichdo exits with a status code indicating success. If the dofile does not exist, redo-whichdo either repeats the previous action with a fallback filename or exits with a status code indicating error if redo-whichdo can not find a dofile to build the target.

If standard output is a terminal, redo-whichdo separates filenames by newline characters. Otherwise, redo-whichdo separates filenames by null characters. Shell scripts that act on the output of redo-whichdo can pipe it to xargs(1) invoked with the -0 option to handle the filenames.

EXAMPLES

Consider a root directory containing only the three dofiles a.do, default.b.do, default.c.do, and a folder d. For the targets, a, a.b, and a.b.c, d/a.b.c, the output of redo-whichdo(1) would be these:

a
    /a.do

a.b
    /a.b.do
    /default.b.do

a.b.c
    /a.b.c.do
    /default.b.c.do
    /default.c.do

d/a.b.c
    /d/a.b.c.do
    /d/default.b.c.do
    /d/default.c.do
    /d/default.do
    /default.b.c.do
    /default.c.do

NOTES

A dofile used to build a target is a dependency of that target: If redo(1) determines that the dofile used to build a target has changed, the target will be rebuilt.

All non-existent dofiles searched for while building a target are non-existence dependencies of that target: If redo(1) finds that a previously searched for non-existent dofile exists, the target will be rebuilt.

HISTORY
redo-whichdo was designed by Avery Pennarun and Nils Dagsson Moskopp as part of Avery Pennarun's redo implementation and independently implemented by Nils Dagsson Moskopp.

AUTHOR
redo-whichdo and this man page were written by Nils Dagsson Moskopp.

COPYRIGHT
Copyright © 2018-2019 Nils Dagsson Moskopp. License AGPLv3+: GNU Affero GPL version 3 or later <http://www.gnu.org/licenses/agpl-3.0.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
redo(1), redo-ifchange(1), redo-ifcreate(1), redo-targets(1)