Changeset 586 for branches

Show
Ignore:
Timestamp:
12/05/04 17:49:18 (4 years ago)
Author:
aj
Message:

add version to all tools.

Location:
branches/openct-0.6
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/openct-0.6/configure.ac

    r563 r586  
    55AC_PREREQ(2.52) 
    66 
    7 AC_INIT(LICENSE) 
    8 AM_INIT_AUTOMAKE(openct, 0.6.2) 
     7AC_INIT(openct, 0.6.2) 
     8AM_INIT_AUTOMAKE 
    99AM_CONFIG_HEADER(config.h) 
    10  
     10   
    1111AC_CONFIG_SRCDIR(src/ifd/ifdhandler.c) 
    1212 
  • branches/openct-0.6/src/ifd/ifdhandler.c

    r551 r586  
    3737 
    3838static void     usage(int exval); 
     39static void     version(void); 
    3940static void     ifdhandler_run(ifd_reader_t *); 
    4041static int      ifdhandler_poll_presence(ct_socket_t *, struct pollfd *); 
     
    5657        umask(033); 
    5758 
    58         while ((c = getopt(argc, argv, "dFHhir:s")) != -1) { 
     59        while ((c = getopt(argc, argv, "dFHhvir:s")) != -1) { 
    5960                switch (c) { 
    6061                case 'd': 
     
    7677                        ct_log_destination("@syslog"); 
    7778                        break; 
     79                case 'v': 
     80                        version(); 
    7881                case 'h': 
    7982                        usage(0); 
     
    392395 
    393396/* 
     397 * Display version 
     398 */ 
     399void 
     400version(void) 
     401{ 
     402        fprintf(stdout, "OpenCT " VERSION "\n"); 
     403        exit(0); 
     404} 
     405 
     406/* 
    394407 * Usage message 
    395408 */ 
     
    405418"  -d   enable debugging; repeat to increase verbosity\n" 
    406419"  -h   display this message\n" 
     420"  -v   display version and exit\n" 
    407421); 
    408422        exit(exval); 
  • branches/openct-0.6/src/ifd/ifdproxy.c

    r481 r586  
    4646static int              list_devices(int, char **); 
    4747static void             usage(int); 
     48static void             version(void); 
    4849 
    4950int 
     
    5859        ct_log_destination("@stderr"); 
    5960 
    60         while ((c = getopt(argc, argv, "df:FR:U:")) != -1) { 
     61        while ((c = getopt(argc, argv, "df:FR:U:v")) != -1) { 
    6162                switch (c) { 
    6263                case 'd': 
     
    7475                case 'U': 
    7576                        opt_user = optarg; 
     77                        break; 
     78                case 'v': 
     79                        version; 
    7680                        break; 
    7781                default: 
     
    98102        if (!strcmp(command, "list")) { 
    99103                list_devices(argc - optind, argv + optind); 
     104        }else 
     105        if (!strcmp(command, "version")) { 
     106                version(); 
    100107        } else { 
    101108                ct_error("Unknown command `%s'\n", command); 
     
    277284 
    278285void 
     286version() 
     287{ 
     288        fprintf(stderr, "OpenCT " VERSION "\n"); 
     289        exit(0); 
     290} 
     291 
     292void 
    279293usage(int exval) 
    280294{ 
     
    284298        "ifdproxy export [-dF] name device address\n" 
    285299        "ifdproxy list [-dF] address\n" 
     300        "ifdproxy version\n" 
    286301               ); 
    287302        exit(exval); 
  • branches/openct-0.6/src/tools/openct-control.c

    r411 r586  
    3131static int              mgr_status(int argc, char **argv); 
    3232static void             usage(int exval); 
     33static void             version(void); 
    3334 
    3435static const char *     opt_config = NULL; 
     
    4647        umask(033); 
    4748 
    48         while ((c = getopt(argc, argv, "df:hs")) != -1) { 
     49        while ((c = getopt(argc, argv, "df:hvs")) != -1) { 
    4950                switch (c) { 
    5051                case 'd': 
     
    5758                        opt_config = optarg; 
    5859                        break; 
     60                case 'v': 
     61                        version(); 
    5962                case 'h': 
    6063                        usage(0); 
     
    267270 
    268271/* 
     272 * Display version 
     273 */ 
     274void 
     275version(void) 
     276{ 
     277        fprintf(stdout, "OpenCT " VERSION "\n"); 
     278        exit(0); 
     279} 
     280 
     281/* 
    269282 * Usage message 
    270283 */ 
     
    278291"  -f   specify config file (default %s)\n" 
    279292"  -h   display this message\n" 
     293"  -v   display version and exit\n" 
    280294"\nWhere command is one of:\n" 
    281295"init - initialize OpenCT\n" 
  • branches/openct-0.6/src/tools/openct-tool.c

    r420 r586  
    2121 
    2222static void     usage(int exval); 
     23static void     version(void); 
    2324static int      do_reset(ct_handle *, unsigned char *, size_t); 
    2425static void     do_select_mf(ct_handle *reader); 
     
    4344        CMD_MF, 
    4445        CMD_READ, 
     46        CMD_VERSION, 
    4547}; 
    4648 
     
    5456        int             c, rc; 
    5557 
    56         while ((c = getopt(argc, argv, "df:r:h")) != -1) { 
     58        while ((c = getopt(argc, argv, "df:r:hv")) != -1) { 
    5759                switch (c) { 
    5860                case 'd': 
     
    6264                        opt_config = optarg; 
    6365                        break; 
     66                case 'v': 
     67                        version(); 
    6468                case 'h': 
    6569                        usage(0); 
     
    182186 
    183187void 
     188version(void) 
     189{ 
     190        fprintf(stdout,"OpenCT " VERSION "\n"); 
     191        exit(0); 
     192} 
     193 
     194void 
    184195usage(int exval) 
    185196{ 
     
    190201"  -r   specify index of reader to use\n" 
    191202"  -h   display this message\n" 
     203"  -v   display version and exit\n" 
    192204"\n" 
    193205"command: can be one of the following\n"