[Refdb-cvs] CVS: refdb/src refdbc.c,1.71,1.72
Status: Beta
Brought to you by:
mhoenicka
|
From: Markus H. <mho...@us...> - 2004-03-31 17:35:25
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22855 Modified Files: refdbc.c Log Message: added and fixed a few comments Index: refdbc.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbc.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -U2 -r1.71 -r1.72 --- refdbc.c 31 Mar 2004 17:13:38 -0000 1.71 +++ refdbc.c 31 Mar 2004 17:23:34 -0000 1.72 @@ -224,5 +224,6 @@ rl_readline_name = readline_name; - /* look for batch command. If found, don't test for CGI environment */ + /* look for batch command. If found, don't test for CGI environment + and change -h behaviour */ for (i = 0; i < argc; i++) { if (argv[i][0] == '-' && argv[i][1] == 'C') { @@ -248,7 +249,4 @@ /* switch on reading from stdin if we receive data on stdin via a redirection or a pipe. */ -/* if (!isatty(fileno(stdin)) && !n_cgi_env) { */ -/* n_read_stdin = 1; */ -/* } */ #ifdef FIONREAD if (ioctl(fileno(stdin), FIONREAD, &n_inbytes) != -1) { @@ -357,4 +355,6 @@ strncpy(the_cmd, optarg, 31); the_cmd[31] = '\0'; + + /* see whether a valid command was requested */ if (!find_command(optarg, commands)) { fprintf (stderr, "%s: No such command for refdb.\n", optarg); @@ -384,4 +384,7 @@ break; case 'h': + /* if we're running in batch mode, assume the -h option pertains + to the requested command. Otherwise display the generic program + help message */ if (!n_batchmode) { fprintf(stderr, "Usage: refdbc [-c pager] [-C command] [-d db] [-e logdest] [-F fields] [-G url] [-h] [-i address] [-l loglevel] [-L logfile] [-p port] [-q] [-R pdfroot] [-T time] [-u name] [-v] [-V] [-w password] [-y confdir]\nOptions: -c command line of pager\n -C run command in batch mode\n -d use database db\n -e log destination (0=stderr;1=syslog;2=custom file)\n -F additional fields in reference output\n -G URL of a css stylesheet for HTML output\n -h prints this help\n -i set server IP address\n -l set log level (0<=level<=7)\n -L full path of custom log file\n -p set server port\n -q ignore init-file\n -R set pdf root directory\n -T set timeout in seconds\n -u use this username\n -v show version information\n -V switch to verbose mode\n -w set password (use '*' to be asked interactively)\n -y look for configuration files in confdir\n"); @@ -389,4 +392,5 @@ } else { + /* pass through the -h option to the command argument list */ if ((new_the_command = mstrcat(the_command, " -h ", &the_command_len, 0)) == NULL) { fprintf(stderr, "out of memory\n"); @@ -1978,7 +1982,7 @@ /* now we have the tokens nicely arranged in inargc */ - for (i = 0; i < inargc; i++) { - printf("inargv[%d]: %s\n", i, inargv[i]); - } +/* for (i = 0; i < inargc; i++) { */ +/* printf("inargv[%d]: %s\n", i, inargv[i]); */ +/* } */ /* get options */ |