diff options
author | Simon Josefsson <simon@josefsson.org> | 2005-08-12 13:12:07 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2005-08-12 13:12:07 +0000 |
commit | 41e487f26b3ffb7a61569bfbf4eb8f786a7b8965 (patch) | |
tree | 7f556c67093112286aa2c415ab2a246c53cef6cc /src/asn1Coding.c | |
parent | 4f953fda50a112104f0ba3b1356cdc49ef716b88 (diff) | |
download | libtasn1-41e487f26b3ffb7a61569bfbf4eb8f786a7b8965.tar.gz libtasn1-41e487f26b3ffb7a61569bfbf4eb8f786a7b8965.tar.bz2 libtasn1-41e487f26b3ffb7a61569bfbf4eb8f786a7b8965.zip |
Use getopt gnulib module. Always use getopt_long.
Diffstat (limited to 'src/asn1Coding.c')
-rw-r--r-- | src/asn1Coding.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/asn1Coding.c b/src/asn1Coding.c index 5a7ad07..62804cb 100644 --- a/src/asn1Coding.c +++ b/src/asn1Coding.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002 Fabio Fiorina + * Copyright (C) 2002, 2005 Fabio Fiorina * * This file is part of LIBTASN1. * @@ -35,10 +35,7 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif - -#ifdef HAVE_GETOPT_H - #include <getopt.h> -#endif +#include <getopt.h> char version_man[] = "asn1Coding (GNU libtasn1) " VERSION; @@ -49,7 +46,6 @@ char help_man[] = "asn1Coding generates a DER encoding from a file\n" " <file1> file with ASN1 definitions.\n" " <file2> file with assignments.\n" "\n" -#ifdef HAVE_GETOPT_LONG "Operation modes:\n" " -h, --help shows this message and exit.\n" " -v, --version shows version information and exit.\n" @@ -57,15 +53,6 @@ char help_man[] = "asn1Coding generates a DER encoding from a file\n" "\n" "Output:\n" " -o <file>, --output <file> output file.\n"; -#else - "Operation modes:\n" - " -h shows this message and exit.\n" - " -v shows version information and exit.\n" - " -c checks the syntax only.\n" - "\n" - "Output:\n" - " -o <file> output file.\n"; -#endif #define ASSIGNMENT_SUCCESS 1 @@ -127,7 +114,6 @@ int main(int argc,char *argv[]) { -#ifdef HAVE_GETOPT_LONG static struct option long_options[] = { {"help", no_argument, 0, 'h'}, @@ -137,8 +123,6 @@ main(int argc,char *argv[]) {0, 0, 0, 0} }; int option_index=0; -#endif - int option_result; char *outputFileName=NULL; char *inputFileAsnName=NULL; @@ -162,11 +146,7 @@ main(int argc,char *argv[]) while(1){ -#ifdef HAVE_GETOPT_LONG option_result=getopt_long(argc,argv,"hvco:",long_options,&option_index); -#else - option_result=getopt(argc,argv,"hvco:"); -#endif if(option_result == -1) break; |