IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 11, 2010, 12:45:59 PM (16 years ago)
Author:
eugene
Message:

add shell-verbosity (echo commmand lines) and function to enable; add fflush calls to gprint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/lib.shell/command.c

    r25440 r27255  
    11# include "opihi.h"
    22# define DEBUG 0
     3
     4static int VERBOSE_SHELL = FALSE;
    35
    46int command (char *line, char **outline, int VERBOSE) {
     
    2931  *outline = line;
    3032 
    31   # if (DEBUG)
    32   fprintf (stderr, "line: %s\n", line);
    33   # endif
     33  if (VERBOSE_SHELL) gprint (GP_ERR, "opihi: %s\n", line);
    3434
    3535  argv = parse_commands (line, &argc);
     
    6060    msg = get_variable_ptr ("ERRORMSG");
    6161    if (msg != (char *) NULL) gprint (GP_ERR, "%s\n", msg);
    62     // gprint (GP_ERR, "error on line: %s\n", rawline);
     62    if (VERBOSE_SHELL) gprint (GP_ERR, "error on line: %s\n", rawline);
    6363  }
    6464
     
    7373}
    7474
     75void set_verbose_shell(int mode) {
     76    VERBOSE_SHELL = mode;
     77}
     78
     79int get_verbose_shell(void) {
     80    return VERBOSE_SHELL;
     81}
     82
     83   
     84
    7585/* parse the input line, search for the corresponding command, and execute it
    7686   if no match is found, return -1; this is used above to distinguish between
Note: See TracChangeset for help on using the changeset viewer.