- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/Ohana
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/Ohana merged eligible /branches/eam_branches/Ohana.20100407 27635-27772 /branches/pap_delete/Ohana 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/tap_branches/Ohana/src/opihi/lib.shell/command.c
r25440 r27838 1 1 # include "opihi.h" 2 2 # define DEBUG 0 3 4 static int VERBOSE_SHELL = OPIHI_VERBOSE_OFF; 3 5 4 6 int command (char *line, char **outline, int VERBOSE) { … … 8 10 Command *cmd; 9 11 10 rawline = NULL;11 //rawline = strcreate (line);12 // rawline = NULL; 13 rawline = strcreate (line); 12 14 13 15 /* force a space between ! and first word: !ls becomes ! ls */ … … 22 24 /* expand anything of the form fred[N] */ 23 25 line = expand_vectors (line); /* line is freed here, new one allocated */ 26 27 // print the line with the variables and vectors expanded, but before evaluating 28 // any in-line math expression 29 if (VERBOSE_SHELL == OPIHI_VERBOSE_ON) gprint (GP_ERR, "opihi: %s\n", line); 30 24 31 /* solve math expresions, assign variable, if needed */ 25 32 line = parse (line); /* line is freed here, new one allocated */ … … 29 36 *outline = line; 30 37 31 # if (DEBUG)32 fprintf (stderr, "line: %s\n", line);33 # endif34 35 38 argv = parse_commands (line, &argc); 36 39 if (argc == 0) { … … 60 63 msg = get_variable_ptr ("ERRORMSG"); 61 64 if (msg != (char *) NULL) gprint (GP_ERR, "%s\n", msg); 62 //gprint (GP_ERR, "error on line: %s\n", rawline);65 if (VERBOSE_SHELL != OPIHI_VERBOSE_OFF) gprint (GP_ERR, "error on line: %s\n", rawline); 63 66 } 64 67 … … 73 76 } 74 77 78 void set_verbose_shell(int mode) { 79 VERBOSE_SHELL = mode; 80 } 81 82 int get_verbose_shell(void) { 83 return VERBOSE_SHELL; 84 } 85 86 87 75 88 /* parse the input line, search for the corresponding command, and execute it 76 89 if no match is found, return -1; this is used above to distinguish between
Note:
See TracChangeset
for help on using the changeset viewer.
