Changes in zcrypt.c [8f335a8:6249a88f]
Legend:
- Unmodified
- Added
- Removed
-
zcrypt.c
r8f335a8 r6249a88f 16 16 #include <sys/wait.h> 17 17 #include <ctype.h> 18 #include <limits.h>19 #include <getopt.h>20 18 21 19 #include <config.h> … … 28 26 29 27 #include "filterproc.h" 30 31 #ifndef OWL_VERSION_STRING32 #ifdef GIT_VERSION33 #define stringify(x) __stringify(x)34 #define __stringify(x) #x35 #define OWL_VERSION_STRING stringify(GIT_VERSION)36 #else37 #define OWL_VERSION_STRING PACKAGE_VERSION38 #endif39 #endif /* !OWL_VERSION_STRING */40 28 41 29 /* Annotate functions in which the caller owns the return value and is … … 118 106 } 119 107 120 void usage(FILE *file, const char *progname)121 {122 fprintf(file, "Usage: %s [-Z|-D|-E|-R|-S] [-F Keyfile] [-c class] [-i instance]\n", progname);123 fprintf(file, " [-advqtluon] [-s signature] [-f arg] [-m message]\n");124 fprintf(file, " One or more of class, instance, and keyfile must be specified.\n");125 }126 127 108 int main(int argc, char *argv[]) 128 109 { … … 135 116 int mode = M_NONE; 136 117 137 intc;118 char c; 138 119 139 120 int messageflag = FALSE; … … 141 122 zoptions.flags = 0; 142 123 143 enum { 144 OPT_VERSION = CHAR_MAX + 1, 145 OPT_HELP, 146 }; 147 static const struct option options[] = { 148 {"version", no_argument, NULL, OPT_VERSION}, 149 {"help", no_argument, NULL, OPT_HELP}, 150 {NULL, 0, NULL, 0} 151 }; 152 153 while ((c = getopt_long(argc, argv, "ZDERSF:c:i:advqtluons:f:m", options, NULL)) != -1) 124 while ((c = getopt(argc, argv, "ZDERSF:c:i:advqtluons:f:m")) != (char)EOF) 154 125 { 155 126 switch(c) 156 127 { 157 case OPT_VERSION:158 /* Version */159 printf("This is zcrypt version %s\n", OWL_VERSION_STRING);160 exit(0);161 case OPT_HELP:162 /* Help */163 usage(stdout, argv[0]);164 exit(0);165 128 case 'Z': 166 129 /* Zephyr encrypt */ … … 294 257 if (error || !cryptspec) 295 258 { 296 usage(stderr, argv[0]); 259 fprintf(stderr, "Usage: %s [-Z|-D|-E|-R|-S] [-F Keyfile] [-c class] [-i instance]\n", argv[0]); 260 fprintf(stderr, " [-advqtluon] [-s signature] [-f arg] [-m message]\n"); 261 fprintf(stderr, " One or more of class, instance, and keyfile must be specified.\n"); 297 262 exit(1); 298 263 }
Note: See TracChangeset
for help on using the changeset viewer.