diff -Naur coreutils-5.97.orig/src/remove.h coreutils-5.97/src/remove.h --- coreutils-5.97.orig/src/remove.h 2005-05-14 02:58:37.000000000 -0500 +++ coreutils-5.97/src/remove.h 2007-01-13 00:15:13.268298115 -0600 @@ -33,6 +33,9 @@ /* If true, recursively remove directories. */ bool recursive; + /* If true, the user is an idiot. */ + bool idiot; + /* Pointer to the device and inode numbers of `/', when --recursive. Otherwise NULL. */ struct dev_ino *root_dev_ino; diff -Naur coreutils-5.97.orig/src/rm.c coreutils-5.97/src/rm.c --- coreutils-5.97.orig/src/rm.c 2005-08-29 16:13:32.000000000 -0500 +++ coreutils-5.97/src/rm.c 2007-01-13 00:17:38.396568504 -0600 @@ -80,6 +80,7 @@ {"directory", no_argument, NULL, 'd'}, {"force", no_argument, NULL, 'f'}, {"interactive", no_argument, NULL, 'i'}, + {"idiot", no_argument, NULL, 'I'}, {"no-preserve-root", no_argument, NULL, NO_PRESERVE_ROOT}, {"preserve-root", no_argument, NULL, PRESERVE_ROOT}, @@ -142,6 +143,7 @@ supports `unlink' for nonempty directories)\n\ -f, --force ignore nonexistent files, never prompt\n\ -i, --interactive prompt before any removal\n\ + -I, --idiot let the ramrod who can't read the man page use -rf\n\ "), stdout); fputs (_("\ --no-preserve-root do not treat `/' specially (the default)\n\ @@ -183,6 +185,7 @@ x->ignore_missing_files = false; x->interactive = false; x->recursive = false; + x->idiot = true; x->root_dev_ino = NULL; x->stdin_tty = isatty (STDIN_FILENO); x->verbose = false; @@ -209,7 +212,7 @@ rm_option_init (&x); - while ((c = getopt_long (argc, argv, "dfirvR", long_opts, NULL)) != -1) + while ((c = getopt_long (argc, argv, "dfiIrvR", long_opts, NULL)) != -1) { switch (c) { @@ -227,6 +230,10 @@ x.ignore_missing_files = false; break; + case 'I': + x.idiot = false; + break; + case 'r': case 'R': x.recursive = true; @@ -275,6 +282,11 @@ error (EXIT_FAILURE, errno, _("failed to get attributes of %s"), quote ("/")); } + + if (x.recursive & x.ignore_missing_files & !x.interactive & x.idiot) + { + error (EXIT_FAILURE, 0, "You are an idiot. Rerun with the --idiot flag."); + } { size_t n_files = argc - optind;