Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zcrypt.c

    r8f335a8 r6249a88f  
    1616#include <sys/wait.h>
    1717#include <ctype.h>
    18 #include <limits.h>
    19 #include <getopt.h>
    2018
    2119#include <config.h>
     
    2826
    2927#include "filterproc.h"
    30 
    31 #ifndef OWL_VERSION_STRING
    32 #ifdef  GIT_VERSION
    33 #define stringify(x)       __stringify(x)
    34 #define __stringify(x)     #x
    35 #define OWL_VERSION_STRING stringify(GIT_VERSION)
    36 #else
    37 #define OWL_VERSION_STRING PACKAGE_VERSION
    38 #endif
    39 #endif /* !OWL_VERSION_STRING */
    4028
    4129/* Annotate functions in which the caller owns the return value and is
     
    118106}
    119107
    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 
    127108int main(int argc, char *argv[])
    128109{
     
    135116  int mode = M_NONE;
    136117
    137   int c;
     118  char c;
    138119
    139120  int messageflag = FALSE;
     
    141122  zoptions.flags = 0;
    142123
    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)
    154125  {
    155126    switch(c)
    156127    {
    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);
    165128      case 'Z':
    166129        /* Zephyr encrypt */
     
    294257  if (error || !cryptspec)
    295258  {
    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");
    297262    exit(1);
    298263  }
Note: See TracChangeset for help on using the changeset viewer.