GNU bug report logs -
#6402
[PATCH] rm: added --directory (-d) option
Previous Next
Reported by: Eric Blake <eblake <at> redhat.com>
Date: Fri, 11 Jun 2010 15:15:02 UTC
Severity: normal
Tags: patch
Done: Jim Meyering <jim <at> meyering.net>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 6402 <at> debbugs.gnu.org (full text, mbox):
* src/rm.c (long_opts, main): Resolve a fixme.
* NEWS: Document the change.
Based on a report by William Plusnick.
---
Jim, what do you think of this alternative patch, which avoids the
issue of a new translation string by instead letting getopt parsing
reject -d like any other unknown option?
NEWS | 2 ++
src/rm.c | 10 +---------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/NEWS b/NEWS
index 3eb28b1..dc398a9 100644
--- a/NEWS
+++ b/NEWS
@@ -48,6 +48,8 @@ GNU coreutils NEWS -*- outline -*-
[The old behavior was introduced in coreutils-6.0 and had been removed
for English only using a different method since coreutils-8.1]
+ rm -d now issues an error rather than being silently ignored.
+
sort -g now uses long doubles for greater range and precision.
sort -h no longer rejects numbers with leading or trailing ".", and
diff --git a/src/rm.c b/src/rm.c
index 42f0a57..3b78e19 100644
--- a/src/rm.c
+++ b/src/rm.c
@@ -63,7 +63,6 @@ enum interactive_type
static struct option const long_opts[] =
{
- {"directory", no_argument, NULL, 'd'},
{"force", no_argument, NULL, 'f'},
{"interactive", optional_argument, NULL, INTERACTIVE_OPTION},
@@ -222,17 +221,10 @@ main (int argc, char **argv)
/* Try to disable the ability to unlink a directory. */
priv_set_remove_linkdir ();
- while ((c = getopt_long (argc, argv, "dfirvIR", long_opts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "firvIR", long_opts, NULL)) != -1)
{
switch (c)
{
- case 'd':
- /* Ignore this option, for backward compatibility with
- 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 = RMI_NEVER;
x.ignore_missing_files = true;
--
1.7.2.3
This bug report was last modified 14 years and 35 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.