diff options
author | assar <assar@FreeBSD.org> | 2001-02-13 16:46:19 +0000 |
---|---|---|
committer | assar <assar@FreeBSD.org> | 2001-02-13 16:46:19 +0000 |
commit | 3a971fe69aad52dfd248901ae796e64a96ae3e37 (patch) | |
tree | ac7b5c62510ffa9f0316643bcb19a3fed3d5bef7 /crypto/heimdal/lib/roken/getarg.3 | |
parent | 2934fc23653f64b32f4db32233d7eda11ca274f0 (diff) | |
parent | ebfe6dc471c206300fd82c7c0fd145f683aa52f6 (diff) | |
download | FreeBSD-src-3a971fe69aad52dfd248901ae796e64a96ae3e37.zip FreeBSD-src-3a971fe69aad52dfd248901ae796e64a96ae3e37.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r72445,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'crypto/heimdal/lib/roken/getarg.3')
-rw-r--r-- | crypto/heimdal/lib/roken/getarg.3 | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/crypto/heimdal/lib/roken/getarg.3 b/crypto/heimdal/lib/roken/getarg.3 index 78a8802..e3b5c9f 100644 --- a/crypto/heimdal/lib/roken/getarg.3 +++ b/crypto/heimdal/lib/roken/getarg.3 @@ -1,5 +1,5 @@ .\" Copyright (c) 1999 Kungliga Tekniska Högskolan -.\" $Id: getarg.3,v 1.2 1999/10/18 17:14:31 joda Exp $ +.\" $Id: getarg.3,v 1.3 2001/01/11 16:16:30 assar Exp $ .Dd September 24, 1999 .Dt GETARG 3 .Os ROKEN @@ -9,13 +9,10 @@ .Nd collect command line options .Sh SYNOPSIS .Fd #include <getarg.h> - .Ft int .Fn getarg "struct getargs *args" "size_t num_args" "int argc" "char **argv" "int *optind" - .Ft void .Fn arg_printusage "struct getargs *args" "size_t num_args" "const char *progname" "const char *extra_string" - .Sh DESCRIPTION .Fn getarg collects any command line options given to a program in an easily used way. @@ -45,7 +42,8 @@ take the same and .Fa num_args as getarg; -.Fa progname is the name of the program (to be used in the help text), and +.Fa progname +is the name of the program (to be used in the help text), and .Fa extra_string is a string to print after the actual options to indicate more arguments. The usefulness of this function is realised only be people @@ -55,7 +53,6 @@ the code does. The .Fa getargs struct has the following elements. - .Bd -literal struct getargs{ const char *long_name; @@ -176,7 +173,7 @@ and .Fa *optarg , but to do this correct you (more or less) have to know about the inner workings of getarg. - +.Pp You can skip parts of arguments by increasing .Fa *optarg (you could @@ -233,8 +230,6 @@ and if you're really confused you can do it multiple times .Pf ( Fl -no-no-help= Ns Ar false , or even .Fl -no-no-help= Ns Ar maybe ) . - -.Pp .Sh EXAMPLE .Bd -literal #include <stdio.h> @@ -276,11 +271,11 @@ main(int argc, char **argv) exit (0); } if (destination == NULL) { - fprintf(stderr, "%s: must specify destination\n", progname); + fprintf(stderr, "%s: must specify destination\en", progname); exit(1); } if (strcmp(source, destination) == 0) { - fprintf(stderr, "%s: destination must be different from source\n"); + fprintf(stderr, "%s: destination must be different from source\en"); exit(1); } /* include more stuff here ... */ @@ -298,7 +293,6 @@ Usage: ship++ [--source=city] [-s city] [--destination=city] [-d city] -w tons, --weight=tons weight of shippment -c, --no-catalog include product catalog .Ed - .Sh BUGS It should be more flexible, so it would be possible to use other more complicated option syntaxes, such as what |