/* `rm' file deletion utility for GNU.
- Copyright (C) 88, 90, 91, 1994-2006 Free Software Foundation, Inc.
+ Copyright (C) 88, 90, 91, 1994-2008 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
+ 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
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Rubin, David MacKenzie, and Richard Stallman.
Reworked to use chdir and avoid recursion by Jim Meyering. */
#define PROGRAM_NAME "rm"
#define AUTHORS \
- "Paul Rubin", "David MacKenzie, Richard Stallman", "Jim Meyering"
-
-/* Name this program was run with. */
-char *program_name;
+ proper_name ("Paul Rubin"), \
+ proper_name ("David MacKenzie"), \
+ proper_name ("Richard M. Stallman"), \
+ proper_name ("Jim Meyering")
/* For long options that have no equivalent short option, use a
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
the contents of that file. If you want more assurance that the contents are\n\
truly unrecoverable, consider using shred.\n\
"), stdout);
- printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
+ emit_bug_reporting_address ();
}
exit (status);
}
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;
int c;
initialize_main (&argc, &argv);
- program_name = argv[0];
+ set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- atexit (close_stdout);
+ atexit (close_stdin);
rm_option_init (&x);
{
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;
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;