diff options
author | Bill Sommerfeld <wesommer@mit.edu> | 1990-02-03 10:40:28 +0000 |
---|---|---|
committer | Bill Sommerfeld <wesommer@mit.edu> | 1990-02-03 10:40:28 +0000 |
commit | 4771917b69129c0225feea34165ca0071346d348 (patch) | |
tree | 630c5decbd87f9dbda8e8f06a12960ce0d9561b7 /src/prototype/getopt.c | |
parent | 85448fb04aa22411ce6276ca3b2cbe7795bf91be (diff) | |
download | krb5-4771917b69129c0225feea34165ca0071346d348.zip krb5-4771917b69129c0225feea34165ca0071346d348.tar.gz krb5-4771917b69129c0225feea34165ca0071346d348.tar.bz2 |
Initial revision
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@245 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/prototype/getopt.c')
-rw-r--r-- | src/prototype/getopt.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/prototype/getopt.c b/src/prototype/getopt.c new file mode 100644 index 0000000..66cbad5 --- /dev/null +++ b/src/prototype/getopt.c @@ -0,0 +1,29 @@ +extern int optind; +extern char *optarg; + +main(argc, argv) + int argc; + char **argv; +{ + int c; + int errflg = 0; + + <<<other globals here>>>; + + while ((c = getopt(argc, argv, "<<<>>>")) != EOF) { + switch (c) { + <<<add cases for arguments here>>>; + case '?': + default: + errflg++; + break; + } + } + if (errflg) { + fprintf(stderr, "Usage: %s <<<args>>>", argv[0]); + exit(2); + } + for (; optind < argc; optind++) { + <<<process arg optind>>>; + } +} |