diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-10-18 10:52:36 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-10-18 10:52:36 +0000 |
commit | 73e5ed22068254b060c57302e56a8b26638370b0 (patch) | |
tree | daf06f91535aebe26fb4e93ea7b63f8d80c75f93 | |
parent | 740eae0585202a5d8fd15847b4f771dff9f28c72 (diff) | |
download | busybox-w32-73e5ed22068254b060c57302e56a8b26638370b0.tar.gz busybox-w32-73e5ed22068254b060c57302e56a8b26638370b0.tar.bz2 busybox-w32-73e5ed22068254b060c57302e56a8b26638370b0.zip |
exclude --longopts from usage texts if those are disabled
-rw-r--r-- | include/usage.h | 186 |
1 files changed, 134 insertions, 52 deletions
diff --git a/include/usage.h b/include/usage.h index 1e05532d5..3ee996172 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -210,21 +210,37 @@ | |||
210 | " -v Set the file's version/generation number" | 210 | " -v Set the file's version/generation number" |
211 | 211 | ||
212 | #define chcon_trivial_usage \ | 212 | #define chcon_trivial_usage \ |
213 | "[OPTIONS] CONTEXT FILE...\n" \ | 213 | "[OPTIONS] CONTEXT FILE..." \ |
214 | " chcon [OPTIONS] [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE...\n" \ | 214 | "\n chcon [OPTIONS] [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE..." \ |
215 | " chcon [OPTIONS] --reference=RFILE FILE...\n" | 215 | USE_FEATURE_CHCON_LONG_OPTIONS( \ |
216 | "\n chcon [OPTIONS] --reference=RFILE FILE..." \ | ||
217 | ) | ||
216 | #define chcon_full_usage \ | 218 | #define chcon_full_usage \ |
217 | "Change the security context of each FILE to CONTEXT\n" \ | 219 | "Change the security context of each FILE to CONTEXT\n" \ |
218 | "\n -v, --verbose Verbose" \ | 220 | USE_FEATURE_CHCON_LONG_OPTIONS( \ |
219 | "\n -c, --changes Report changes made" \ | 221 | "\n -v,--verbose Verbose" \ |
220 | "\n -h, --no-dereference Affect symlinks instead of their targets" \ | 222 | "\n -c,--changes Report changes made" \ |
221 | "\n -f, --silent, --quiet Suppress most error messages" \ | 223 | "\n -h,--no-dereference Affect symlinks instead of their targets" \ |
224 | "\n -f,--silent,--quiet Suppress most error messages" \ | ||
222 | "\n --reference=RFILE Use RFILE's group instead of using a CONTEXT value" \ | 225 | "\n --reference=RFILE Use RFILE's group instead of using a CONTEXT value" \ |
223 | "\n -u, --user=USER Set user USER in the target security context" \ | 226 | "\n -u,--user=USER Set user USER in the target security context" \ |
224 | "\n -r, --role=ROLE Set role ROLE in the target security context" \ | 227 | "\n -r,--role=ROLE Set role ROLE in the target security context" \ |
225 | "\n -t, --type=TYPE Set type TYPE in the target security context" \ | 228 | "\n -t,--type=TYPE Set type TYPE in the target security context" \ |
226 | "\n -l, --range=RANGE Set range RANGE in the target security context" \ | 229 | "\n -l,--range=RANGE Set range RANGE in the target security context" \ |
227 | "\n -R, --recursive Recurse subdirectories" \ | 230 | "\n -R,--recursive Recurse subdirectories" \ |
231 | ) \ | ||
232 | SKIP_FEATURE_CHCON_LONG_OPTIONS( \ | ||
233 | "\n -v Verbose" \ | ||
234 | "\n -c Report changes made" \ | ||
235 | "\n -h Affect symlinks instead of their targets" \ | ||
236 | "\n -f Suppress most error messages" \ | ||
237 | "\n -u USER Set user USER in the target security context" \ | ||
238 | "\n -r ROLE Set role ROLE in the target security context" \ | ||
239 | "\n -t TYPE Set type TYPE in the target security context" \ | ||
240 | "\n -l RNG Set range RNE in the target security context" \ | ||
241 | "\n -R Recurse subdirectories" \ | ||
242 | ) | ||
243 | |||
228 | 244 | ||
229 | #define chmod_trivial_usage \ | 245 | #define chmod_trivial_usage \ |
230 | "[-R"USE_DESKTOP("cvf")"] MODE[,MODE]... FILE..." | 246 | "[-R"USE_DESKTOP("cvf")"] MODE[,MODE]... FILE..." |
@@ -780,9 +796,16 @@ | |||
780 | #define dumpleases_full_usage \ | 796 | #define dumpleases_full_usage \ |
781 | "Display DHCP leases granted by udhcpd" \ | 797 | "Display DHCP leases granted by udhcpd" \ |
782 | "\n\nOptions:\n" \ | 798 | "\n\nOptions:\n" \ |
783 | " -f, --file=FILENAME Leases file to load\n" \ | 799 | USE_GETOPT_LONG( \ |
784 | " -r, --remaining Interpret lease times as time remaining\n" \ | 800 | " -f,--file=FILE Leases file to load\n" \ |
785 | " -a, --absolute Interpret lease times as expire time" | 801 | " -r,--remaining Interpret lease times as time remaining\n" \ |
802 | " -a,--absolute Interpret lease times as expire time" \ | ||
803 | ) \ | ||
804 | SKIP_GETOPT_LONG( \ | ||
805 | " -f FILE Leases file to load\n" \ | ||
806 | " -r Interpret lease times as time remaining\n" \ | ||
807 | " -a Interpret lease times as expire time" \ | ||
808 | ) | ||
786 | 809 | ||
787 | #define e2fsck_trivial_usage \ | 810 | #define e2fsck_trivial_usage \ |
788 | "[-panyrcdfvstDFSV] [-b superblock] [-B blocksize] " \ | 811 | "[-panyrcdfvstDFSV] [-b superblock] [-B blocksize] " \ |
@@ -1079,21 +1102,38 @@ | |||
1079 | #define ftpget_full_usage \ | 1102 | #define ftpget_full_usage \ |
1080 | "Retrieve a remote file via FTP" \ | 1103 | "Retrieve a remote file via FTP" \ |
1081 | "\n\nOptions:\n" \ | 1104 | "\n\nOptions:\n" \ |
1082 | " -c, --continue Continue a previous transfer\n" \ | 1105 | USE_GETOPT_LONG( \ |
1083 | " -v, --verbose Verbose\n" \ | 1106 | " -c,--continue Continue previous transfer\n" \ |
1084 | " -u, --username Username to be used\n" \ | 1107 | " -v,--verbose Verbose\n" \ |
1085 | " -p, --password Password to be used\n" \ | 1108 | " -u,--username Username\n" \ |
1086 | " -P, --port Port number to be used" | 1109 | " -p,--password Password\n" \ |
1110 | " -P,--port Port number" \ | ||
1111 | ) \ | ||
1112 | SKIP_GETOPT_LONG( \ | ||
1113 | " -c Continue previous transfer\n" \ | ||
1114 | " -v Verbose\n" \ | ||
1115 | " -u Username\n" \ | ||
1116 | " -p Password\n" \ | ||
1117 | " -P Port number" \ | ||
1118 | ) | ||
1087 | 1119 | ||
1088 | #define ftpput_trivial_usage \ | 1120 | #define ftpput_trivial_usage \ |
1089 | "[options] remote-host remote-file local-file" | 1121 | "[options] remote-host remote-file local-file" |
1090 | #define ftpput_full_usage \ | 1122 | #define ftpput_full_usage \ |
1091 | "Store a local file on a remote machine via FTP" \ | 1123 | "Store a local file on a remote machine via FTP" \ |
1092 | "\n\nOptions:\n" \ | 1124 | "\n\nOptions:\n" \ |
1093 | " -v, --verbose Verbose\n" \ | 1125 | USE_GETOPT_LONG( \ |
1094 | " -u, --username Username to be used\n" \ | 1126 | " -v,--verbose Verbose\n" \ |
1095 | " -p, --password Password to be used\n" \ | 1127 | " -u,--username Username\n" \ |
1096 | " -P, --port Port number to be used" | 1128 | " -p,--password Password\n" \ |
1129 | " -P,--port Port number" \ | ||
1130 | ) \ | ||
1131 | SKIP_GETOPT_LONG( \ | ||
1132 | " -v Verbose\n" \ | ||
1133 | " -u Username\n" \ | ||
1134 | " -p Password\n" \ | ||
1135 | " -P Port number" \ | ||
1136 | ) | ||
1097 | 1137 | ||
1098 | #define fuser_trivial_usage \ | 1138 | #define fuser_trivial_usage \ |
1099 | "[options] file OR port/proto" | 1139 | "[options] file OR port/proto" |
@@ -1113,15 +1153,28 @@ | |||
1113 | "[OPTIONS]..." | 1153 | "[OPTIONS]..." |
1114 | #define getopt_full_usage \ | 1154 | #define getopt_full_usage \ |
1115 | "Parse command options\n" \ | 1155 | "Parse command options\n" \ |
1116 | " -a, --alternative Allow long options starting with single -\n" \ | 1156 | USE_GETOPT_LONG( \ |
1117 | " -l, --longoptions=longopts Long options to be recognized\n" \ | 1157 | " -a,--alternative Allow long options starting with single -\n" \ |
1118 | " -n, --name=progname The name under which errors are reported\n" \ | 1158 | " -l,--longoptions=longopts Long options to be recognized\n" \ |
1119 | " -o, --options=optstring Short options to be recognized\n" \ | 1159 | " -n,--name=progname The name under which errors are reported\n" \ |
1120 | " -q, --quiet Disable error reporting by getopt(3)\n" \ | 1160 | " -o,--options=optstring Short options to be recognized\n" \ |
1121 | " -Q, --quiet-output No normal output\n" \ | 1161 | " -q,--quiet Disable error reporting by getopt(3)\n" \ |
1122 | " -s, --shell=shell Set shell quoting conventions\n" \ | 1162 | " -Q,--quiet-output No normal output\n" \ |
1123 | " -T, --test Test for getopt(1) version\n" \ | 1163 | " -s,--shell=shell Set shell quoting conventions\n" \ |
1124 | " -u, --unquoted Do not quote the output" | 1164 | " -T,--test Test for getopt(1) version\n" \ |
1165 | " -u,--unquoted Don't quote the output" \ | ||
1166 | ) \ | ||
1167 | SKIP_GETOPT_LONG( \ | ||
1168 | " -a Allow long options starting with single -\n" \ | ||
1169 | " -l longopts Long options to be recognized\n" \ | ||
1170 | " -n progname The name under which errors are reported\n" \ | ||
1171 | " -o optstring Short options to be recognized\n" \ | ||
1172 | " -q Disable error reporting by getopt(3)\n" \ | ||
1173 | " -Q No normal output\n" \ | ||
1174 | " -s shell Set shell quoting conventions\n" \ | ||
1175 | " -T Test for getopt(1) version\n" \ | ||
1176 | " -u Don't quote the output" \ | ||
1177 | ) | ||
1125 | #define getopt_example_usage \ | 1178 | #define getopt_example_usage \ |
1126 | "$ cat getopt.test\n" \ | 1179 | "$ cat getopt.test\n" \ |
1127 | "#!/bin/sh\n" \ | 1180 | "#!/bin/sh\n" \ |
@@ -2551,13 +2604,19 @@ | |||
2551 | " -u Unlocks (re-enables) the specified user account" | 2604 | " -u Unlocks (re-enables) the specified user account" |
2552 | 2605 | ||
2553 | #define chpasswd_trivial_usage \ | 2606 | #define chpasswd_trivial_usage \ |
2554 | "[--md5|--encrypt]" | 2607 | USE_GETOPT_LONG("[--md5|--encrypt]") SKIP_GETOPT_LONG("[-m|-e]") |
2555 | #define chpasswd_full_usage \ | 2608 | #define chpasswd_full_usage \ |
2556 | "Read user:password information from stdin\n" \ | 2609 | "Read user:password information from stdin\n" \ |
2557 | "and update /etc/passwd accordingly." \ | 2610 | "and update /etc/passwd accordingly." \ |
2558 | "\n\nOptions:" \ | 2611 | "\n\nOptions:" \ |
2559 | "\n -e, --encrypt Supplied passwords are in encrypted form" \ | 2612 | USE_GETOPT_LONG( \ |
2560 | "\n -m, --md5 Use MD5 encryption instead of DES" | 2613 | "\n -e,--encrypt Supplied passwords are in encrypted form" \ |
2614 | "\n -m,--md5 Use MD5 encryption instead of DES" \ | ||
2615 | ) \ | ||
2616 | SKIP_GETOPT_LONG( \ | ||
2617 | "\n -e Supplied passwords are in encrypted form" \ | ||
2618 | "\n -m Use MD5 encryption instead of DES" \ | ||
2619 | ) | ||
2561 | 2620 | ||
2562 | #define patch_trivial_usage \ | 2621 | #define patch_trivial_usage \ |
2563 | "[-p num] [-i diff]" | 2622 | "[-p num] [-i diff]" |
@@ -3187,27 +3246,50 @@ USE_FEATURE_RUN_PARTS_FANCY("\n -l Prints names of all matching files even when | |||
3187 | "$ cat TODO | split -a 2 -l 2 TODO_\n" | 3246 | "$ cat TODO | split -a 2 -l 2 TODO_\n" |
3188 | 3247 | ||
3189 | #define start_stop_daemon_trivial_usage \ | 3248 | #define start_stop_daemon_trivial_usage \ |
3190 | "[OPTIONS] [--start|--stop] ... [-- arguments...]" | 3249 | "[OPTIONS] [" \ |
3250 | USE_GETOPT_LONG("--start|--stop") SKIP_GETOPT_LONG("-S|-K") \ | ||
3251 | "] ... [-- arguments...]" | ||
3191 | #define start_stop_daemon_full_usage \ | 3252 | #define start_stop_daemon_full_usage \ |
3192 | "Start and stop services" \ | 3253 | "Start and stop services" \ |
3193 | "\n\nOptions:" \ | 3254 | "\n\nOptions:" \ |
3194 | "\n -S|--start Start" \ | 3255 | USE_GETOPT_LONG( \ |
3195 | "\n -K|--stop Stop" \ | 3256 | "\n -S,--start Start" \ |
3196 | "\n -a|--startas pathname Starts process specified by pathname" \ | 3257 | "\n -K,--stop Stop" \ |
3197 | "\n -b|--background Put process into background" \ | 3258 | "\n -a,--startas pathname Starts process specified by pathname" \ |
3198 | "\n -u|--user username|uid Stop this user's processes" \ | 3259 | "\n -b,--background Put process into background" \ |
3199 | "\n -x|--exec executable Program to either start or check" \ | 3260 | "\n -u,--user username|uid Stop this user's processes" \ |
3200 | "\n -m|--make-pidfile Create the -p file and enter pid in it" \ | 3261 | "\n -x,--exec executable Program to either start or check" \ |
3201 | "\n -n|--name process-name Stop processes with this name" \ | 3262 | "\n -n,--name process-name Stop processes with this name" \ |
3202 | "\n -p|--pidfile pid-file Save or load pid using a pid-file" \ | 3263 | "\n -p,--pidfile pid-file Save or load pid using a pid-file" \ |
3203 | "\n -q|--quiet Quiet" \ | 3264 | "\n -m,--make-pidfile Create the -p file and enter pid in it" \ |
3265 | "\n -q,--quiet Quiet" \ | ||
3204 | USE_FEATURE_START_STOP_DAEMON_FANCY( \ | 3266 | USE_FEATURE_START_STOP_DAEMON_FANCY( \ |
3205 | "\n -o|--oknodo Exit status 0 if nothing done" \ | 3267 | "\n -o,--oknodo Exit status 0 if nothing done" \ |
3206 | "\n -v|--verbose Verbose" \ | 3268 | "\n -v,--verbose Verbose" \ |
3207 | "\n -N|--nicelevel N Add N to process's nice level" \ | 3269 | "\n -N,--nicelevel N Add N to process's nice level" \ |
3208 | ) \ | 3270 | ) \ |
3209 | "\n -s|--signal signal Signal to send (default TERM)" \ | 3271 | "\n -s,--signal signal Signal to send (default TERM)" \ |
3210 | "\n -c|--chuid user[:[group]] Change to specified user/group" | 3272 | "\n -c,--chuid user[:[grp]] Change to specified user/group" \ |
3273 | ) \ | ||
3274 | SKIP_GETOPT_LONG( \ | ||
3275 | "\n -S Start" \ | ||
3276 | "\n -K Stop" \ | ||
3277 | "\n -a pathname Starts process specified by pathname" \ | ||
3278 | "\n -b Put process into background" \ | ||
3279 | "\n -u username|uid Stop this user's processes" \ | ||
3280 | "\n -x executable Program to either start or check" \ | ||
3281 | "\n -n process-name Stop processes with this name" \ | ||
3282 | "\n -p pid-file Save or load pid using a pid-file" \ | ||
3283 | "\n -m Create the -p file and enter pid in it" \ | ||
3284 | "\n -q Quiet" \ | ||
3285 | USE_FEATURE_START_STOP_DAEMON_FANCY( \ | ||
3286 | "\n -o Exit status 0 if nothing done" \ | ||
3287 | "\n -v Verbose" \ | ||
3288 | "\n -N N Add N to process's nice level" \ | ||
3289 | ) \ | ||
3290 | "\n -s signal Signal to send (default TERM)" \ | ||
3291 | "\n -c user[:[grp]] Change to specified user/group" \ | ||
3292 | ) | ||
3211 | 3293 | ||
3212 | #define stat_trivial_usage \ | 3294 | #define stat_trivial_usage \ |
3213 | "[OPTION] FILE..." | 3295 | "[OPTION] FILE..." |