Changeset 1183 for trunk/src/kmk/kmkbuiltin/rmdir.c
- Timestamp:
- Oct 6, 2007, 12:16:46 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/rmdir.c
r1151 r1183 51 51 #include <unistd.h> 52 52 #include "getopt.h" 53 #include "kmkbuiltin.h" 53 54 54 55 #ifdef _MSC_VER … … 57 58 58 59 static int rm_path(char *); 59 static int usage( void);60 static int usage(FILE *); 60 61 61 62 static int pflag; … … 66 67 static struct option long_options[] = 67 68 { 69 { "help", no_argument, 0, 262 }, 68 70 { "ignore-fail-on-non-empty", no_argument, 0, 260 }, 69 71 { "ignore-fail-on-not-exist", no_argument, 0, 261 }, 70 72 { "parents", no_argument, 0, 'p' }, 71 73 { "verbose", no_argument, 0, 'v' }, 74 { "version", no_argument, 0, 263 }, 72 75 { 0, 0, 0, 0 }, 73 76 }; … … 75 78 76 79 int 77 kmk_builtin_rmdir(int argc, char *argv[] )80 kmk_builtin_rmdir(int argc, char *argv[], char **envp) 78 81 { 79 82 int ch, errors; … … 102 105 ignore_fail_on_not_exist = 1; 103 106 break; 107 case 262: 108 return kbuild_version(argv[0]); 109 case 263: 110 usage(stdout); 111 return 0; 104 112 case '?': 105 113 default: 106 return usage( );114 return usage(stderr); 107 115 } 108 116 argc -= optind; … … 110 118 111 119 if (argc == 0) 112 return /*usage( )*/0;120 return /*usage(stderr)*/0; 113 121 114 122 for (errors = 0; *argv; argv++) { … … 181 189 182 190 static int 183 usage( void)191 usage(FILE *pf) 184 192 { 185 186 (void)fprintf(stderr, "usage: rmdir [-pv --ignore-fail-on-non-empty --ignore-fail-on-not-exist] directory ...\n"); 193 (void)fprintf(pf, "usage: %s [-pv --ignore-fail-on-non-empty --ignore-fail-on-not-exist] directory ...\n" 194 " or: %s --help\n" 195 " or: %s --version\n", 196 g_progname, g_progname, g_progname); 187 197 return 1; 188 198 }
Note:
See TracChangeset
for help on using the changeset viewer.