-func usage() {
- fmt.Fprintf(os.Stderr, versionGet()+`
-Copyright (C) 2020-2021 Sergey Matveev
-License GPLv3: GNU GPL version 3 <http://gnu.org/licenses/gpl.html>
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law.
-
-redo, redo-{always,cleanup,dot,ifchange,ifcreate,log,stamp,whichdo} must
-be linked to goredo executable. It determines the command by its own name.
-You can create them by running: goredo -symlinks.
-
-* redo [options] [target ...]
- forcefully and *sequentially* build specified targets
-* redo-always
- always build current target. Unusable outside .do
-* redo-cleanup {full,log,tmp} [...]
- remove either all goredo's related temporary files, or kept stderr
- logs, or everything (including .redo directories) related
-* redo-dot target [...]
- write dependency DOT graph to stdout
-* redo-ifchange target [...]
- build specified targets in parallel, if they are changed. Record them
- as dependencies for current target
-* redo-ifcreate target [...]
- record ifcreate dependency for current target. Unusable outside .do
-* redo-log target [ | tai64nlocal ]
- display kept target's stderr with TAI64N timestamped lines. Only the
- last build is kept. You must enable stderr keeping with either -logs,
- or REDO_LOGS=1
-* redo-stamp < [$3]
- record stamp dependency for current target. Unusable outside .do.
- Stamp dependency does not play any role, as all targets are hashed
- anyway
-* redo-whichdo target
- display .do search paths for specified target. Exits successfully
- if the last .do in output if the found existing one
-
-Options:
-`)
+Record stamp dependency for current target. Unusable outside .do.
+Stamp dependency does not play any role, as all targets are hashed
+anyway.`
+ case CmdNameRedoWhichdo:
+ d = `Usage: redo-whichdo target
+
+Display .do search paths for specified target. Exits successfully
+if the last .do in output if the found existing one.`
+ case CmdNameRedoTargets:
+ d = `Usage: redo-targets [target ...]
+
+List all currently known targets.`
+ case CmdNameRedoSources:
+ d = `Usage: redo-sources [target ...]
+
+List all currently known source files.`
+ case CmdNameRedoOOD:
+ d = `Usage: redo-ood [target ...]
+
+List all currently known out-of-date targets.`
+ case CmdNameRedoAffects:
+ d = `Usage: redo-affects target [...]
+
+List all targets that will be affected by changing the specified ones.`
+ case CmdNameRedoDepFix:
+ d = `Usage: redo-depfix
+
+Traverse over all .redo directories beneath and check if inode's information
+(ctime/mtime) differs. Update dependency if file's content is still the same.`
+ default:
+ d = `Usage: goredo -symlinks
+
+goredo expects to be called through the symbolic link to it.
+Available commands: redo, redo-affects, redo-always, redo-cleanup,
+redo-depfix, redo-dot, redo-ifchange, redo-ifcreate, redo-log,
+redo-ood, redo-sources, redo-stamp, redo-targets, redo-whichdo.`
+ }
+ fmt.Fprintf(os.Stderr, "%s\n\nCommon options:\n", d)