bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: options to retire?


From: Jim Meyering
Subject: Re: options to retire?
Date: Sat, 15 Oct 2005 12:23:36 +0200

Paul Eggert <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>
>> du's -m doesn't provoke a diagnostic, so I'll add one
>> and push the removal date to 2006.
>
> This the only change you mentioned that I have any qualms about.
> FreeBSD's du has -m, and I found a reasonable number of people
> suggesting and/or using "du -m":
>
> http://www.dsl.org/cookbook/cookbook_31.html
> http://aaltonen.us/archive/2003/03/26/
> http://www.cc.gatech.edu/people/home/oxblood/Linux_Doc.txt
> http://envgen.nox.ac.uk/courses/Bio-Linux/Bio-Linux_Aug2003/advanced_bio-linux_CLI_ps_etc.pdf
> http://www.ippp.dur.ac.uk/Computing/files.html
>
> So we might be stuck with it.

That's enough evidence for me.
I'll leave du's -m option in.
Thanks for looking into it.

Here's the NEWS:

* Major changes in release 5.91-cvs (2005-??-??) [stable]

** Removed options

  tail's --allow-missing option has been removed.  Use --retry instead.

  stat's --link and -l options have been removed.
  Use --dereference (-L) instead.

** Deprecated options

  Using ls, du, or df with the --kilobytes option now evokes a warning
  that the long-named option is deprecated.  Use `-k' instead.

  du's long-named --megabytes option now evokes a warning.
  Use -m instead.

And here are the remaining diffs:

2005-10-15  Jim Meyering  <address@hidden>

        * src/df.c (main): Warn about the deprecated --kilobytes option.
        * src/ls.c (decode_switches): Likewise.

        * src/du.c (usage): Document -m, once again.
        (main): Warn about use of deprecated long options:
        --kilobytes and --megabytes.
        * src/tail.c (parse_options): Remove --allow-missing option.
        You can use --retry instead.
        * src/stat.c (main): Remove --link -l options.
        You can use --dereference (-L) instead.

Index: df.c
===================================================================
RCS file: /fetish/cu/src/df.c,v
retrieving revision 1.168
diff -u -p -r1.168 df.c
--- df.c        16 Aug 2005 20:33:40 -0000      1.168
+++ df.c        15 Oct 2005 09:16:49 -0000
@@ -114,8 +114,10 @@ static bool print_type;
    non-character as a pseudo short option, starting with CHAR_MAX + 1.  */
 enum
 {
-  SYNC_OPTION = CHAR_MAX + 1,
-  NO_SYNC_OPTION
+  NO_SYNC_OPTION = CHAR_MAX + 1,
+  /* FIXME: --kilobytes is deprecated (but not -k); remove in late 2006 */
+  KILOBYTES_LONG_OPTION,
+  SYNC_OPTION
 };
 
 static struct option const long_options[] =
@@ -125,7 +127,7 @@ static struct option const long_options[
   {"inodes", no_argument, NULL, 'i'},
   {"human-readable", no_argument, NULL, 'h'},
   {"si", no_argument, NULL, 'H'},
-  {"kilobytes", no_argument, NULL, 'k'}, /* long form is obsolescent */
+  {"kilobytes", no_argument, NULL, KILOBYTES_LONG_OPTION},
   {"local", no_argument, NULL, 'l'},
   {"megabytes", no_argument, NULL, 'm'}, /* obsolescent */
   {"portability", no_argument, NULL, 'P'},
@@ -802,6 +804,10 @@ main (int argc, char **argv)
          human_output_opts = human_autoscale | human_SI;
          output_block_size = 1;
          break;
+       case KILOBYTES_LONG_OPTION:
+         error (0, 0,
+                _("the --kilobytes option is deprecated; use -k instead"));
+         /* fall through */
        case 'k':
          human_output_opts = 0;
          output_block_size = 1024;
Index: du.c
===================================================================
RCS file: /fetish/cu/src/du.c,v
retrieving revision 1.222
diff -u -p -r1.222 du.c
--- du.c        16 Sep 2005 08:08:32 -0000      1.222
+++ du.c        15 Oct 2005 09:13:21 -0000
@@ -196,7 +196,15 @@ enum
   EXCLUDE_OPTION,
   FILES0_FROM_OPTION,
   HUMAN_SI_OPTION,
+
+  /* FIXME: --kilobytes is deprecated (but not -k); remove in late 2006 */
+  KILOBYTES_LONG_OPTION,
+
   MAX_DEPTH_OPTION,
+
+  /* FIXME: --megabytes is deprecated (but not -m); remove in late 2006 */
+  MEGABYTES_LONG_OPTION,
+
   TIME_OPTION,
   TIME_STYLE_OPTION
 };
@@ -215,10 +223,10 @@ static struct option const long_options[
   {"files0-from", required_argument, NULL, FILES0_FROM_OPTION},
   {"human-readable", no_argument, NULL, 'h'},
   {"si", no_argument, NULL, HUMAN_SI_OPTION},
-  {"kilobytes", no_argument, NULL, 'k'}, /* long form is obsolescent */
+  {"kilobytes", no_argument, NULL, KILOBYTES_LONG_OPTION},
   {"max-depth", required_argument, NULL, MAX_DEPTH_OPTION},
   {"null", no_argument, NULL, '0'},
-  {"megabytes", no_argument, NULL, 'm'}, /* obsolescent */
+  {"megabytes", no_argument, NULL, MEGABYTES_LONG_OPTION},
   {"no-dereference", no_argument, NULL, 'P'},
   {"one-file-system", no_argument, NULL, 'x'},
   {"separate-dirs", no_argument, NULL, 'S'},
@@ -300,6 +308,7 @@ Mandatory arguments to long options are 
       --si              like -h, but use powers of 1000 not 1024\n\
   -k                    like --block-size=1K\n\
   -l, --count-links     count sizes many times if hard linked\n\
+  -m                    like --block-size=1M\n\
 "), stdout);
       fputs (_("\
   -L, --dereference     dereference all symbolic links\n\
@@ -731,7 +740,8 @@ main (int argc, char **argv)
          output_block_size = 1;
          break;
 
-       case 'H':
+       case 'H':  /* FIXME: remove warning and move this "case 'H'" to
+                     precede --dereference-args in late 2006.  */
          error (0, 0, _("WARNING: use --si, not -H; the meaning of the -H\
  option will soon\nchange to be the same as that of --dereference-args (-D)"));
          /* fall through */
@@ -740,6 +750,10 @@ main (int argc, char **argv)
          output_block_size = 1;
          break;
 
+       case KILOBYTES_LONG_OPTION:
+         error (0, 0,
+                _("the --kilobytes option is deprecated; use -k instead"));
+         /* fall through */
        case 'k':
          human_output_opts = 0;
          output_block_size = 1024;
@@ -763,7 +777,11 @@ main (int argc, char **argv)
          }
          break;
 
-       case 'm': /* obsolescent: FIXME: remove in 2005. */
+       case MEGABYTES_LONG_OPTION:
+         error (0, 0,
+                _("the --megabytes option is deprecated; use -m instead"));
+         /* fall through */
+       case 'm':
          human_output_opts = 0;
          output_block_size = 1024 * 1024;
          break;
Index: ls.c
===================================================================
RCS file: /fetish/cu/src/ls.c,v
retrieving revision 1.399
diff -u -p -r1.399 ls.c
--- ls.c        16 Sep 2005 07:50:33 -0000      1.399
+++ ls.c        15 Oct 2005 09:17:06 -0000
@@ -732,6 +732,10 @@ enum
   FULL_TIME_OPTION,
   HIDE_OPTION,
   INDICATOR_STYLE_OPTION,
+
+  /* FIXME: --kilobytes is deprecated (but not -k); remove in late 2006 */
+  KILOBYTES_LONG_OPTION,
+
   QUOTING_STYLE_OPTION,
   SHOW_CONTROL_CHARS_OPTION,
   SI_OPTION,
@@ -749,7 +753,7 @@ static struct option const long_options[
   {"full-time", no_argument, NULL, FULL_TIME_OPTION},
   {"human-readable", no_argument, NULL, 'h'},
   {"inode", no_argument, NULL, 'i'},
-  {"kilobytes", no_argument, NULL, 'k'}, /* long form is obsolescent */
+  {"kilobytes", no_argument, NULL, KILOBYTES_LONG_OPTION},
   {"numeric-uid-gid", no_argument, NULL, 'n'},
   {"no-group", no_argument, NULL, 'G'},
   {"hide-control-chars", no_argument, NULL, 'q'},
@@ -1532,6 +1536,10 @@ decode_switches (int argc, char **argv)
          print_inode = true;
          break;
 
+       case KILOBYTES_LONG_OPTION:
+         error (0, 0,
+                _("the --kilobytes option is deprecated; use -k instead"));
+         /* fall through */
        case 'k':
          human_output_opts = 0;
          file_output_block_size = output_block_size = 1024;
Index: stat.c
===================================================================
RCS file: /fetish/cu/src/stat.c,v
retrieving revision 1.88
diff -u -p -r1.88 stat.c
--- stat.c      16 Sep 2005 07:50:33 -0000      1.88
+++ stat.c      14 Oct 2005 13:55:40 -0000
@@ -101,7 +101,6 @@
 #define AUTHORS "Michael Meskes"
 
 static struct option const long_options[] = {
-  {"link", no_argument, NULL, 'l'}, /* deprecated.  FIXME: remove in 2003 */
   {"dereference", no_argument, NULL, 'L'},
   {"file-system", no_argument, NULL, 'f'},
   {"filesystem", no_argument, NULL, 'f'}, /* obsolete and undocumented alias */
@@ -768,7 +767,7 @@ main (int argc, char *argv[])
 
   atexit (close_stdout);
 
-  while ((c = getopt_long (argc, argv, "c:fLlt", long_options, NULL)) != -1)
+  while ((c = getopt_long (argc, argv, "c:fLt", long_options, NULL)) != -1)
     {
       switch (c)
        {
@@ -776,9 +775,6 @@ main (int argc, char *argv[])
          format = optarg;
          break;
 
-       case 'l': /* deprecated */
-         error (0, 0, _("Warning: `-l' is deprecated; use `-L' instead"));
-         /* fall through */
        case 'L':
          follow_links = true;
          break;
Index: tail.c
===================================================================
RCS file: /fetish/cu/src/tail.c,v
retrieving revision 1.242
diff -u -p -r1.242 tail.c
--- tail.c      16 Sep 2005 07:50:33 -0000      1.242
+++ tail.c      14 Oct 2005 13:56:44 -0000
@@ -190,7 +190,6 @@ static bool presume_input_pipe;
 enum
 {
   RETRY_OPTION = CHAR_MAX + 1,
-  ALLOW_MISSING_OPTION,   /* deprecated, FIXME: remove in late 2004 */
   MAX_UNCHANGED_STATS_OPTION,
   PID_OPTION,
   PRESUME_INPUT_PIPE_OPTION,
@@ -199,8 +198,6 @@ enum
 
 static struct option const long_options[] =
 {
-  /* FIXME: remove in 2005 --allow-missing is deprecated; use --retry instead 
*/
-  {"allow-missing", no_argument, NULL, ALLOW_MISSING_OPTION},
   {"bytes", required_argument, NULL, 'c'},
   {"follow", optional_argument, NULL, LONG_FOLLOW_OPTION},
   {"lines", required_argument, NULL, 'n'},
@@ -1493,10 +1490,6 @@ parse_options (int argc, char **argv,
                                     follow_mode_string, follow_mode_map);
          break;
 
-       case ALLOW_MISSING_OPTION:
-         error (0, 0,
-          _("the --allow-missing option is deprecated; use --retry instead"));
-         /* fall through */
        case RETRY_OPTION:
          reopen_inaccessible_files = true;
          break;

Index: doc/coreutils.texi
===================================================================
RCS file: /fetish/cu/doc/coreutils.texi,v
retrieving revision 1.286
retrieving revision 1.287
diff -u -p -u -r1.286 -r1.287
--- doc/coreutils.texi  13 Oct 2005 20:12:10 -0000      1.286
+++ doc/coreutils.texi  15 Oct 2005 08:34:48 -0000      1.287
@@ -9004,6 +9004,13 @@ Dereference symbolic links (show the dis
 or directory that the link points to instead of the space used by
 the link).
 
address@hidden -m
address@hidden -m
address@hidden mebibytes for file sizes
+Print sizes in 1,048,576-byte blocks, overriding the default block size
+(@pxref{Block size}).
+This option is equivalent to @option{--block-size=1M}.
+
 @item -P
 @itemx --no-dereference
 @opindex -P




reply via email to

[Prev in Thread] Current Thread [Next in Thread]