Changeset 481 for trunk/src/sh_getopt.c


Ignore:
Timestamp:
Jul 18, 2015, 5:06:52 PM (9 years ago)
Author:
katerina
Message:

Enhancements and fixes for tickets #374, #375, #376, #377, #378, and #379.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_getopt.c

    r467 r481  
    3434#include "sh_utils.h"
    3535#include "sh_mail.h"
    36 #include "sh_forward.h"
     36#include "sh_xfer.h"
    3737#include "sh_hash.h"
     38#include "sh_dbIO.h"
     39#include "sh_dbCheck.h"
     40#include "sh_dbCreate.h"
     41#include "sh_sem.h"
    3842
    3943#if defined(WITH_EXTERNAL)
     
    6468#if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE)
    6569static int sh_getopt_forever (const char * dummy);
     70static int sh_getopt_outpath (const char * dummy);
    6671#endif
    6772static int sh_getopt_copyright (const char * dummy);
     
    9297    N_("Set the server port to connect to"), 
    9398    HAS_ARG_YES,
    94     sh_forward_server_port },
     99    sh_xfer_server_port },
    95100  { N_("server-host"), 
    96101    '-',
    97102    N_("Set the server host to connect to"), 
    98103    HAS_ARG_YES,
    99     sh_forward_setlogserver },
     104    sh_xfer_set_logserver },
    100105#endif
    101106#ifdef SH_WITH_SERVER
     
    109114    N_("Log fully qualified name of client host"), 
    110115    HAS_ARG_NO,
    111     sh_forward_set_strip },
     116    sh_xfer_set_strip },
    112117  { N_("chroot"), 
    113118    '-',
     
    222227    N_("Compute a client registry entry for password"), 
    223228    HAS_ARG_YES,
    224     sh_forward_make_client },
     229    sh_xfer_make_client },
    225230  { N_("gen-password"), 
    226231    'G',
    227232    N_("Generate a random password"), 
    228233    HAS_ARG_NO,
    229     sh_forward_create_password },
     234    sh_xfer_create_password },
    230235#endif
    231236
     
    236241    HAS_ARG_NO,
    237242    sh_getopt_forever},
     243  { N_("outfile"), 
     244    'o',
     245    N_("Pathname for output file"), 
     246    HAS_ARG_YES,
     247    sh_getopt_outpath},
    238248  { N_("list-file"), 
    239249    '-',
    240     N_("Modify -d to list content of a single file"), 
     250    N_("Modify -d to show content of a single file"), 
    241251    HAS_ARG_YES,
    242252    set_list_file},
     253  { N_("list-filter"), 
     254    '-',
     255    N_("Modify -d to filter by file list given in text file"), 
     256    HAS_ARG_YES,
     257    sh_dbIO_list_filter},
    243258  { N_("full-detail"), 
    244259    'a',
    245     N_("Modify -d to list full details"), 
     260    N_("Modify -d to show full details"), 
    246261    HAS_ARG_NO,
    247262    set_full_detail},
    248263  { N_("delimited"), 
    249264    '-',
    250     N_("Modify -d to list full details, comma delimited"), 
     265    N_("Modify -d to show full details, comma delimited"), 
    251266    HAS_ARG_NO,
    252267    set_list_delimited},
     268  { N_("binary"), 
     269    '-',
     270    N_("Modify -d to output in binary database format"), 
     271    HAS_ARG_NO,
     272    sh_dbIO_list_binary},
    253273  { N_("list-database"), 
    254274    'd',
    255275    N_("List database content (like ls -l)"), 
    256276    HAS_ARG_YES,
    257     sh_hash_list_db},
     277    sh_dbIO_list_db},
    258278  { N_("init2stdout"), 
    259279    '-',
    260280    N_("Write database to stdout on init"), 
    261281    HAS_ARG_NO,
    262     sh_hash_pushdata_stdout},
     282    sh_dbIO_writeout_stdout},
     283  { N_("verify-database"), 
     284    '-',
     285    N_("Verify the given database"), 
     286    HAS_ARG_YES,
     287    sh_dbCheck_verify},
     288  { N_("create-database"), 
     289    '-',
     290    N_("Create database from file list"), 
     291    HAS_ARG_YES,
     292    sh_dbCreate},
     293  { N_("wait-on-check"), 
     294    'w',
     295    N_("Timed wait for end of filecheck (0 for no timeout)"), 
     296    HAS_ARG_YES,
     297    sh_sem_wait},
    263298#endif
    264299  { N_("trace-logfile"), 
     
    744779  sh.flag.loop = S_TRUE;
    745780  SL_RETURN(0, _("sh_getopt_forever"));
     781}
     782
     783static int sh_getopt_outpath (const char * str)
     784{
     785  if (str)
     786    {
     787      if (sh.outpath)
     788        SH_FREE(sh.outpath);
     789      sh.outpath = sh_util_strdup(str);
     790      return 0;
     791    }
     792  return -1;
    746793}
    747794#endif 
Note: See TracChangeset for help on using the changeset viewer.