- Timestamp:
- Nov 30, 2007 1:28:30 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk_redirect/kmk_redirect.c
r1278 r1281 47 47 { 48 48 fprintf(pOut, 49 "usage: %s [-[rwa+tb]<fd> 49 "usage: %s [-[rwa+tb]<fd>[=|:| ]<file>] -- <program> [args]\n" 50 50 " or: %s --help\n" 51 51 " or: %s --version\n" 52 52 "\n" 53 53 "The rwa+tb is like for fopen, if not specified it defaults to w+.\n" 54 "The <fd> is either a number or an alias for the standard handles;\n" 55 "i - stdin, o - stdout, e - stderr.\n" 54 "The <fd> is either a number or an alias for the standard handles:\n" 55 " i = stdin\n" 56 " o = stdout\n" 57 " e = stderr\n" 58 "\n" 59 "This command is really just a quick hack to avoid invoking the shell\n" 60 "on Windows (cygwin) where forking is very expensive and has exhibited\n" 61 "stability issues on SMP machines. This tool may be retired when kBuild\n" 62 "starts using the kmk_kash shell.\n" 56 63 , 57 64 argv0, argv0, argv0); … … 68 75 FILE *pStdErr = stderr; 69 76 FILE *pStdOut = stdout; 70 71 77 72 78 /* … … 245 251 if (*psz) 246 252 { 247 fprintf(pStdErr, "%s: syntax error: characters following the file descriptor: '%s' ('%s')\n", argv[0], psz, argv[i]); 248 return 1; 249 } 250 i++; 251 if (i >= argc ) 252 { 253 fprintf(pStdErr, "%s: syntax error: missing filename argument.\n", argv[0]); 254 return 1; 255 } 256 psz = argv[i]; 253 if (*psz != ':' && *psz != '=') 254 { 255 fprintf(pStdErr, "%s: syntax error: characters following the file descriptor: '%s' ('%s')\n", argv[0], psz, argv[i]); 256 return 1; 257 } 258 psz++; 259 } 260 else 261 { 262 i++; 263 if (i >= argc) 264 { 265 fprintf(pStdErr, "%s: syntax error: missing filename argument.\n", argv[0]); 266 return 1; 267 } 268 psz = argv[i]; 269 } 257 270 258 271 /*
Note:
See TracChangeset
for help on using the changeset viewer.