summaryrefslogtreecommitdiff
path: root/src/rm.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-01-17 17:02:40 +0100
committerJim Meyering <jim@meyering.net>2007-01-17 17:15:20 +0100
commit0928c2414ab21682600e6572bc628a405fb1ea80 (patch)
treeff030e34af21eb8a8252af6773e54848e18df05b /src/rm.c
parentd1ad73e0bf6a1b6c62e424c1f28cf344fca10600 (diff)
downloadcoreutils-0928c2414ab21682600e6572bc628a405fb1ea80.tar.xz
Make "rm --interactive=never ..." never prompt.
* NEWS: Mention this. * src/remove.h (enum rm_interactive): New ternary type. (struct rm_options) [interactive]: Use it, here -- rather than bool. * src/remove.c (prompt): Reflect type change. * src/mv.c (rm_option_init): Initialize to RMI_NEVER now. * src/rm.c (main): Add a FIXME comment for '-d' option. Adapt to type change of rm_options.interactive. * tests/rm/i-never: New file. Test for the above fix. * tests/rm/Makefile.am (TESTS): Add i-never.
Diffstat (limited to 'src/rm.c')
-rw-r--r--src/rm.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/rm.c b/src/rm.c
index 364a21cf5..81f81ec7f 100644
--- a/src/rm.c
+++ b/src/rm.c
@@ -1,5 +1,5 @@
/* `rm' file deletion utility for GNU.
- Copyright (C) 88, 90, 91, 1994-2006 Free Software Foundation, Inc.
+ Copyright (C) 88, 90, 91, 1994-2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -213,7 +213,7 @@ static void
rm_option_init (struct rm_options *x)
{
x->ignore_missing_files = false;
- x->interactive = false;
+ x->interactive = RMI_SOMETIMES;
x->one_file_system = false;
x->recursive = false;
x->root_dev_ino = NULL;
@@ -249,25 +249,25 @@ main (int argc, char **argv)
{
case 'd':
/* Ignore this option, for backward compatibility with
- coreutils 5.92. Some time after 2005, we'll change this
+ coreutils 5.92. FIXME: Some time after 2005, change this
to report an error (or perhaps behave like FreeBSD does)
instead of ignoring the option. */
break;
case 'f':
- x.interactive = false;
+ x.interactive = RMI_NEVER;
x.ignore_missing_files = true;
prompt_once = false;
break;
case 'i':
- x.interactive = true;
+ x.interactive = RMI_ALWAYS;
x.ignore_missing_files = false;
prompt_once = false;
break;
case 'I':
- x.interactive = false;
+ x.interactive = RMI_NEVER;
x.ignore_missing_files = false;
prompt_once = true;
break;
@@ -288,18 +288,18 @@ main (int argc, char **argv)
switch (i)
{
case interactive_never:
- x.interactive = false;
+ x.interactive = RMI_NEVER;
prompt_once = false;
break;
case interactive_once:
- x.interactive = false;
+ x.interactive = RMI_SOMETIMES;
x.ignore_missing_files = false;
prompt_once = true;
break;
case interactive_always:
- x.interactive = true;
+ x.interactive = RMI_ALWAYS;
x.ignore_missing_files = false;
prompt_once = false;
break;