- /* Parse any options */
- while (argc > 0 && **argv == '-') {
- while (i==FALSE && *++(*argv)) {
- switch (**argv) {
- case 'm':
- if (--argc == 0)
- usage( mkdir_usage);
- /* Find the specified modes */
- mode = 0;
- if ( parse_mode(*(++argv), &mode) == FALSE ) {
- fprintf(stderr, "Unknown mode: %s\n", *argv);
- exit( FALSE);
+ while ((opt = getopt (argc, argv, "m:p")) != -1) {
+ switch (opt) {
+ case 'm':
+ mode = 0777;
+ if (!parse_mode (optarg, &mode))
+ error_msg_and_die ("invalid mode `%s'", optarg);
+ break;
+ case 'p':
+ flags |= FILEUTILS_RECUR;
+ break;
+ default:
+ show_usage ();