From e5266ff974756af546b3c35202a845ef3b5a5f6a Mon Sep 17 00:00:00 2001 From: Bernhard Walle Date: Thu, 21 Oct 2010 19:55:29 +0200 Subject: [PATCH] getopt.3: Use constants in getopt_long() example The description of getopt_long() mentions the constants required_argument, no_argument and optional_argument. Use them in the example to make the code easier to understand. Signed-off-by: Bernhard Walle --- man3/getopt.3 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/man3/getopt.3 b/man3/getopt.3 index 6fb3d6160..b594de4b1 100644 --- a/man3/getopt.3 +++ b/man3/getopt.3 @@ -444,13 +444,13 @@ main(int argc, char **argv) int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 1, 0, \(aqc\(aq}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} + {"add", required_argument, 0, 0 }, + {"append", no_argument, 0, 0 }, + {"delete", required_argument, 0, 0 }, + {"verbose", no_argument, 0, 0 }, + {"create", required_argument, 0, \(aqc\(aq}, + {"file", required_argument, 0, 0 }, + {0, 0, 0, 0 } }; c = getopt_long(argc, argv, "abc:d:012",