Changeset 5175cf8 for zcrypt.c


Ignore:
Timestamp:
Apr 19, 2013, 3:22:54 AM (8 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master
Children:
8f335a8
Parents:
478dc8e
git-author:
Anders Kaseorg <andersk@mit.edu> (04/10/13 00:19:24)
git-committer:
Anders Kaseorg <andersk@mit.edu> (04/19/13 03:22:54)
Message:
zcrypt: Accept --version

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zcrypt.c

    r478dc8e r5175cf8  
    2828#include "filterproc.h"
    2929
     30#ifndef OWL_VERSION_STRING
     31#ifdef  GIT_VERSION
     32#define stringify(x)       __stringify(x)
     33#define __stringify(x)     #x
     34#define OWL_VERSION_STRING stringify(GIT_VERSION)
     35#else
     36#define OWL_VERSION_STRING PACKAGE_VERSION
     37#endif
     38#endif /* !OWL_VERSION_STRING */
     39
    3040/* Annotate functions in which the caller owns the return value and is
    3141 * responsible for ensuring it is freed. */
     
    123133  zoptions.flags = 0;
    124134
     135  enum {
     136    OPT_VERSION = CHAR_MAX + 1,
     137  };
    125138  static const struct option options[] = {
     139    {"version", no_argument, NULL, OPT_VERSION},
    126140    {NULL, 0, NULL, 0}
    127141  };
     
    131145    switch(c)
    132146    {
     147      case OPT_VERSION:
     148        /* Version */
     149        printf("This is zcrypt version %s\n", OWL_VERSION_STRING);
     150        exit(0);
    133151      case 'Z':
    134152        /* Zephyr encrypt */
Note: See TracChangeset for help on using the changeset viewer.