bug-coreutils
[Top][All Lists]
Advanced

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

[PATCH]: nl: deprecate --page-increment in favour of --line-increment


From: Giuseppe Scrivano
Subject: [PATCH]: nl: deprecate --page-increment in favour of --line-increment
Date: Tue, 18 Aug 2009 12:47:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Hello,

--page-increment seems the wrong name for this option, --line-increment
is clearer. what do you think of this change?

Cheers,
Giuseppe

>From e71bee2c6731fe65c07744ac95e1e4058eea773c Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <address@hidden>
Date: Tue, 18 Aug 2009 12:22:37 +0200
Subject: [PATCH] nl: deprecate --page-increment in favour of --line-increment

* NEWS: Mention the change.
* doc/coreutils.texi: Document the --line-increment option.
* src/nl.c (struct option): Add --line-increment,
(usage): Describe it,
(main): Use it.
---
 NEWS               |    5 +++++
 doc/coreutils.texi |    4 ++--
 src/nl.c           |    9 +++++++--
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 85cc82b..d485e44 100644
--- a/NEWS
+++ b/NEWS
@@ -40,6 +40,11 @@ GNU coreutils NEWS                                    -*- 
outline -*-
   were renamed from 'HARDLINK' and 'hl' which were available since
   coreutils-7.1 when this feature was introduced.
 
+** Deprecated options
+
+  nl --page-increment: deprecated in favour of --line-increment, the new option
+  maintains the previous semantic and the same short option, -i.
+
 ** New features
 
   chroot now accepts the options --userspec and --groups.
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index bb1d87a..8e1b73d 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -1688,9 +1688,9 @@ Analogous to @option{--body-numbering}.
 Analogous to @option{--body-numbering}.
 
 @item -i @var{number}
address@hidden address@hidden
address@hidden address@hidden
 @opindex -i
address@hidden --page-increment
address@hidden --line-increment
 Increment line numbers by @var{number} (default 1).
 
 @item -l @var{number}
diff --git a/src/nl.c b/src/nl.c
index 2deb314..ea7ebe6 100644
--- a/src/nl.c
+++ b/src/nl.c
@@ -150,7 +150,9 @@ static struct option const longopts[] =
   {"body-numbering", required_argument, NULL, 'b'},
   {"footer-numbering", required_argument, NULL, 'f'},
   {"starting-line-number", required_argument, NULL, 'v'},
-  {"page-increment", required_argument, NULL, 'i'},
+  {"line-increment", required_argument, NULL, 'i'},
+  /* FIXME: page-increment is deprecated, remove in dec-2011.  */
+  {"page-increment", required_argument, NULL, 'I'},
   {"no-renumber", no_argument, NULL, 'p'},
   {"join-blank-lines", required_argument, NULL, 'l'},
   {"number-separator", required_argument, NULL, 's'},
@@ -191,7 +193,7 @@ Mandatory arguments to long options are mandatory for short 
options too.\n\
 "), stdout);
       fputs (_("\
   -h, --header-numbering=STYLE    use STYLE for numbering header lines\n\
-  -i, --page-increment=NUMBER     line number increment at each line\n\
+  -i, --line-increment=NUMBER     line number increment at each line\n\
   -l, --join-blank-lines=NUMBER   group of NUMBER empty lines counted as one\n\
   -n, --number-format=FORMAT      insert line numbers according to FORMAT\n\
   -p, --no-renumber               do not reset line numbers at logical pages\n\
@@ -504,6 +506,9 @@ main (int argc, char **argv)
              ok = false;
            }
          break;
+  case 'I':
+    error (0, 0, _("\
+--page-increment is deprecated, use --line-increment instead."));
        case 'i':
          if (! (xstrtoimax (optarg, NULL, 10, &page_incr, "") == LONGINT_OK
                 && 0 < page_incr))
-- 
1.6.3.3




reply via email to

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