diff options
author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-03-28 20:35:13 +0000 |
---|---|---|
committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-03-28 20:35:13 +0000 |
commit | a854a75a5ba2ee6461ccdf776e402e4581e2cc1d (patch) | |
tree | 56db2b5e6a6592670c47a840798c6ec53639d5e5 /include/usage.h | |
parent | a2c2dbe65e4186eb4ac81f1ee459346f9caf5a96 (diff) | |
download | busybox-w32-a854a75a5ba2ee6461ccdf776e402e4581e2cc1d.tar.gz busybox-w32-a854a75a5ba2ee6461ccdf776e402e4581e2cc1d.tar.bz2 busybox-w32-a854a75a5ba2ee6461ccdf776e402e4581e2cc1d.zip |
- rewrite run-parts
text data bss dec hex filename
1029 0 0 1029 405 debianutils/run_parts.o-old
478 0 0 478 1de debianutils/run_parts.o-new-bare
600 0 0 600 258 debianutils/run_parts.o-new-full
bare, i.e. without long opts and fancy stuff
./scripts/bloat-o-meter bb_old busybox_unstripped function old new delta
act - 215 +215
run_parts_main 216 201 -15
valid_name 50 - -50
runparts_long_options 64 - -64
.rodata 124323 124163 -160
run_parts 513 - -513
------------------------------------------------------------------------------
(add/remove: 1/3 grow/shrink: 0/2 up/down: 215/-802) Total: -587 bytes
git-svn-id: svn://busybox.net/trunk/busybox@18265 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'include/usage.h')
-rw-r--r-- | include/usage.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/usage.h b/include/usage.h index d948c6a03..a19bcf7c2 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -2760,13 +2760,28 @@ | |||
2760 | " -l, --range=RNG Levelrange" \ | 2760 | " -l, --range=RNG Levelrange" \ |
2761 | 2761 | ||
2762 | #define run_parts_trivial_usage \ | 2762 | #define run_parts_trivial_usage \ |
2763 | "[-t] [-a ARG] [-u MASK] DIRECTORY" | 2763 | "[-t] "USE_FEATURE_RUN_PARTS_FANCY("[-l] ")"[-a ARG] [-u MASK] DIRECTORY" |
2764 | #define run_parts_full_usage \ | 2764 | #define run_parts_full_usage \ |
2765 | "Run a bunch of scripts in a directory" \ | 2765 | "Run a bunch of scripts in a directory" \ |
2766 | "\n\nOptions:\n" \ | 2766 | "\n\nOptions:\n" \ |
2767 | " -t Prints what would be run, but does not actually run anything\n" \ | 2767 | " -t Prints what would be run, but does not actually run anything\n" \ |
2768 | " -a ARG Pass ARG as an argument for every program invoked\n" \ | 2768 | " -a ARG Pass ARG as an argument for every program invoked\n" \ |
2769 | " -u MASK Set the umask to MASK before executing every program" | 2769 | " -u MASK Set the umask to MASK before executing every program" \ |
2770 | USE_FEATURE_RUN_PARTS_FANCY("\n -l Prints names of all matching files even when they are not executable") | ||
2771 | |||
2772 | #define run_parts_example_usage \ | ||
2773 | "$ run-parts -a start /etc/init.d\n" \ | ||
2774 | "$ run-parts -a stop=now /etc/init.d\n\n" \ | ||
2775 | "Let's assume you have a script foo/dosomething:\n" \ | ||
2776 | "#!/bin/sh\n" \ | ||
2777 | "for i in $*; do eval $i; done ; unset i\n" \ | ||
2778 | "case \"$1\" in\n" \ | ||
2779 | "start*) echo starting something ;;\n" \ | ||
2780 | "stop*) set -x ; shutdown -h $stop ;;\n" \ | ||
2781 | "esac\n\n" \ | ||
2782 | "Running this yields:\n" \ | ||
2783 | "$run-parts -a stop=+4m foo/\n" \ | ||
2784 | "+ shutdown -h +4m" | ||
2770 | 2785 | ||
2771 | #define runlevel_trivial_usage \ | 2786 | #define runlevel_trivial_usage \ |
2772 | "[utmp]" | 2787 | "[utmp]" |