diff options
| author | Jim Meyering <jim@meyering.net> | 2007-01-17 17:02:40 +0100 |
|---|---|---|
| committer | Jim Meyering <jim@meyering.net> | 2007-01-17 17:15:20 +0100 |
| commit | 0928c2414ab21682600e6572bc628a405fb1ea80 (patch) | |
| tree | ff030e34af21eb8a8252af6773e54848e18df05b /src/remove.h | |
| parent | * bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore, (diff) | |
| download | coreutils-0928c2414ab21682600e6572bc628a405fb1ea80.tar.gz coreutils-0928c2414ab21682600e6572bc628a405fb1ea80.zip | |
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/remove.h')
| -rw-r--r-- | src/remove.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/remove.h b/src/remove.h index 2dc617618..ae01e3c6c 100644 --- a/src/remove.h +++ b/src/remove.h @@ -1,6 +1,6 @@ /* Remove directory entries. - Copyright (C) 1998, 2000, 2002, 2003, 2004, 2005, 2006 Free + Copyright (C) 1998, 2000, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -22,13 +22,22 @@ # include "dev-ino.h" +enum rm_interactive +{ + /* Start with any number larger than 1, so that any legacy tests + against values of 0 or 1 will fail. */ + RMI_ALWAYS = 3, + RMI_SOMETIMES, + RMI_NEVER +}; + struct rm_options { /* If true, ignore nonexistent files. */ bool ignore_missing_files; /* If true, query the user about whether to remove each file. */ - bool interactive; + enum rm_interactive interactive; /* If true, do not traverse into (or remove) any directory that is on a file system (i.e., that has a different device number) other |
