Hello,
I saw a FIXME in the source of seq from coreutils, so I decided to
implement it. The patch, which includes an extra line for the man page,
is attached to this message. I didn't bother to patch the info file, but
can do so if required.
Ian
--
Ian Macdonald | Dignity is like a flag. It flaps in a
System Administrator | storm. -- Roy Mengot
[EMAIL PROTECTED] |
http://www.caliban.org |
|
diff -uNr coreutils-5.0.orig/man/seq.1 coreutils-5.0/man/seq.1
--- coreutils-5.0.orig/man/seq.1 2003-03-30 04:13:40.000000000 -0800
+++ coreutils-5.0/man/seq.1 2003-12-28 23:41:10.000000000 -0800
@@ -22,6 +22,9 @@
\fB\-s\fR, \fB\-\-separator\fR=\fISTRING\fR
use STRING to separate numbers (default: \en)
.TP
+\fB\-t\fR, \fB\-\-terminator\fR=\fISTRING\fR
+use STRING to terminate numbers (default: \en)
+.TP
\fB\-w\fR, \fB\-\-equal\-width\fR
equalize width by padding with leading zeroes
.TP
diff -uNr coreutils-5.0.orig/src/seq.c coreutils-5.0/src/seq.c
--- coreutils-5.0.orig/src/seq.c 2003-03-20 05:16:25.000000000 -0800
+++ coreutils-5.0/src/seq.c 2003-12-28 23:40:03.000000000 -0800
@@ -45,8 +45,7 @@
/* The string output after all numbers have been output.
Usually "\n" or "\0". */
-/* FIXME: make this an option. */
-static char *terminator = "\n";
+static char *terminator;
/* The representation of the decimal point in the current locale.
Always "." if the localeconv function is not supported. */
@@ -66,6 +65,7 @@
{ "equal-width", no_argument, NULL, 'w'},
{ "format", required_argument, NULL, 'f'},
{ "separator", required_argument, NULL, 's'},
+ { "terminator", required_argument, NULL, 't'},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
{ NULL, 0, NULL, 0}
@@ -89,6 +89,7 @@
\n\
-f, --format=FORMAT use printf style floating-point FORMAT (default: %g)\n\
-s, --separator=STRING use STRING to separate numbers (default: \\n)\n\
+ -t, --terminator=STRING use STRING to terminate numbers (default: \\n)\n\
-w, --equal-width equalize width by padding with leading zeroes\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
@@ -348,6 +349,7 @@
equal_width = 0;
separator = "\n";
+ terminator = "\n";
first = 1.0;
step_is_set = 0;
@@ -376,7 +378,7 @@
break;
}
- optc = getopt_long (argc, argv, "+f:s:w", long_options, NULL);
+ optc = getopt_long (argc, argv, "+f:s:t:w", long_options, NULL);
if (optc == -1)
break;
@@ -393,6 +395,10 @@
separator = optarg;
break;
+ case 't':
+ terminator = optarg;
+ break;
+
case 'w':
equal_width = 1;
break;
_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils