move help text from include/usage.src.h to debianutils/*.c e2fsprogs/*.c editors...
[oweals/busybox.git] / debianutils / run_parts.c
index b93a5a917a0f94c1ba609ec49c10ba9dd63188f7..0c230269635f000cb5a510b3b81f09beb798b5ae 100644 (file)
  * -u MASK      umask. Set the umask of the program executed to MASK.
  */
 
+//usage:#define run_parts_trivial_usage
+//usage:       "[-t] "IF_FEATURE_RUN_PARTS_FANCY("[-l] ")"[-a ARG] [-u MASK] DIRECTORY"
+//usage:#define run_parts_full_usage "\n\n"
+//usage:       "Run a bunch of scripts in DIRECTORY\n"
+//usage:     "\nOptions:"
+//usage:     "\n       -t      Print what would be run, but don't actually run anything"
+//usage:     "\n       -a ARG  Pass ARG as argument for every program"
+//usage:     "\n       -u MASK Set the umask to MASK before running every program"
+//usage:       IF_FEATURE_RUN_PARTS_FANCY(
+//usage:     "\n       -l      Print names of all matching files even if they are not executable"
+//usage:       )
+//usage:
+//usage:#define run_parts_example_usage
+//usage:       "$ run-parts -a start /etc/init.d\n"
+//usage:       "$ run-parts -a stop=now /etc/init.d\n\n"
+//usage:       "Let's assume you have a script foo/dosomething:\n"
+//usage:       "#!/bin/sh\n"
+//usage:       "for i in $*; do eval $i; done; unset i\n"
+//usage:       "case \"$1\" in\n"
+//usage:       "start*) echo starting something;;\n"
+//usage:       "stop*) set -x; shutdown -h $stop;;\n"
+//usage:       "esac\n\n"
+//usage:       "Running this yields:\n"
+//usage:       "$run-parts -a stop=+4m foo/\n"
+//usage:       "+ shutdown -h +4m"
+
 #include "libbb.h"
 
 struct globals {