diff options
author | Pere Orga | 2011-04-11 03:29:49 +0200 |
---|---|---|
committer | Denys Vlasenko | 2011-04-11 03:29:49 +0200 |
commit | 5bc8c005a8e15c43285bc595a8d404de67a482ac (patch) | |
tree | 98f2d35d1db26f4d8cba5f095ff63bf8e2e8d980 /util-linux/getopt.c | |
parent | 73ef15cf3894716c1393ed21dee6e6bb2cdbc90f (diff) | |
download | busybox-5bc8c005a8e15c43285bc595a8d404de67a482ac.zip busybox-5bc8c005a8e15c43285bc595a8d404de67a482ac.tar.gz |
move remaining help text from include/usage.src.h
Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/getopt.c')
-rw-r--r-- | util-linux/getopt.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 7c49853..10e1dc4 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c @@ -31,6 +31,54 @@ * */ +//usage:#define getopt_trivial_usage +//usage: "[OPTIONS]" +//usage:#define getopt_full_usage "\n\n" +//usage: "Options:" +//usage: IF_LONG_OPTS( +//usage: "\n -a,--alternative Allow long options starting with single -" +//usage: "\n -l,--longoptions=longopts Long options to be recognized" +//usage: "\n -n,--name=progname The name under which errors are reported" +//usage: "\n -o,--options=optstring Short options to be recognized" +//usage: "\n -q,--quiet Disable error reporting by getopt(3)" +//usage: "\n -Q,--quiet-output No normal output" +//usage: "\n -s,--shell=shell Set shell quoting conventions" +//usage: "\n -T,--test Test for getopt(1) version" +//usage: "\n -u,--unquoted Don't quote the output" +//usage: ) +//usage: IF_NOT_LONG_OPTS( +//usage: "\n -a Allow long options starting with single -" +//usage: "\n -l longopts Long options to be recognized" +//usage: "\n -n progname The name under which errors are reported" +//usage: "\n -o optstring Short options to be recognized" +//usage: "\n -q Disable error reporting by getopt(3)" +//usage: "\n -Q No normal output" +//usage: "\n -s shell Set shell quoting conventions" +//usage: "\n -T Test for getopt(1) version" +//usage: "\n -u Don't quote the output" +//usage: ) +//usage: +//usage:#define getopt_example_usage +//usage: "$ cat getopt.test\n" +//usage: "#!/bin/sh\n" +//usage: "GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \\\n" +//usage: " -n 'example.busybox' -- \"$@\"`\n" +//usage: "if [ $? != 0 ]; then exit 1; fi\n" +//usage: "eval set -- \"$GETOPT\"\n" +//usage: "while true; do\n" +//usage: " case $1 in\n" +//usage: " -a|--a-long) echo \"Option a\"; shift;;\n" +//usage: " -b|--b-long) echo \"Option b, argument '$2'\"; shift 2;;\n" +//usage: " -c|--c-long)\n" +//usage: " case \"$2\" in\n" +//usage: " \"\") echo \"Option c, no argument\"; shift 2;;\n" +//usage: " *) echo \"Option c, argument '$2'\"; shift 2;;\n" +//usage: " esac;;\n" +//usage: " --) shift; break;;\n" +//usage: " *) echo \"Internal error!\"; exit 1;;\n" +//usage: " esac\n" +//usage: "done\n" + #include <getopt.h> #include "libbb.h" |