+Sun Oct 24 00:31:02 1993 Jim Meyering (meyering@comco.com)
+
+ * join.c (main): Accept `-v 1' again. First adding --version
+ long option had broken it, though -v1 still worked. Call
+ parse_long_options instead of adding "help" and "version"
+ to join's longopt strct.
+ * Makefile.in [SOURCES, OBJECTS, DISTFILES]: Add long-options.c
+ and long-options.h.
+ * (join): Depend on and link with long-options.o.
+ * (join.o): Depend on long-options.h.
+
+ * od.c: Change --compatible (-C) to --backward-compatible (-B).
+
+ * csplit.c: Change --abandon-null-files to --elide-empty-files.
+
Sat Oct 23 01:00:12 1993 Jim Meyering (meyering@comco.com)
* tr.c (get_next, string2_extend): Add default: label to switch stmt.
join.c, nl.c, od.c, paste.c, pr.c, sort.c, split.c, sum.c, tac.c,
tail.c, tr.c, unexpand.c, uniq.c, version.c, wc.c: Ditto.
- * configure.in: Use AC_CONIG_HEADER.
+ * configure.in: Use AC_CONFIG_HEADER.
* Makefile.in [DIST]: Add config.h.in.
* Makefile.in: Convert so make may be run from subdirectories.
Major changes in release 1.9:
* cat -v /dev/null works on more systems
+* od's --compatible (-C) flag renamed to --backward-compatible (-B)
+* --help and --version exit successfully
+* --help gives a one-line description of each option and shows the
+ correspondence between short and long-named options.
+* fix bug in cut. Now `echo 'a:b:c:' | cut -d: -f3-' works.
+ Before it printed `c' instead of `c:'
+* csplit allows repeat counts to be specified via `{*}'.
+* csplit accepts a new option, --suffix=format that supercedes the
+ --digits option. The --digits option will continue to work.
+* csplit accepts a new option, --elide-empty-files.
+* configure uses config.h, so DEFS won't exceed preprocessor limits of
+ some compilers on the number of symbols defined via -D.
+* work around problem where $(srcdir)/config.h was used instead of
+ ../config.h -- this happened only when building in a subdirectory
+ and when config.h remained in $(srcdir) from a previous ./configure.
+\f
Major changes in release 1.8:
* added non-ANSIfied version of memchr.c from GNU libc.
\f
static boolean remove_files;
/* If TRUE, remove all output files which have a zero length. */
-static boolean abandon_null_files;
+static boolean elide_empty_files;
/* The compiled pattern arguments, which determine how to split
the input file. */
{"quiet", no_argument, NULL, 'q'},
{"silent", no_argument, NULL, 's'},
{"keep-files", no_argument, NULL, 'k'},
- {"abandon-null-files", no_argument, NULL, 'z'},
+ {"elide-empty-files", no_argument, NULL, 'z'},
{"prefix", required_argument, NULL, 'f'},
{"suffix", required_argument, NULL, 'b'},
{"help", no_argument, &show_help, 1},
error (0, errno, "write error for `%s'", output_filename);
cleanup ();
}
- if (bytes_written == 0 && abandon_null_files)
+ if (bytes_written == 0 && elide_empty_files)
{
if (unlink (output_filename))
error (0, errno, "%s", output_filename);
break;
case 'z':
- abandon_null_files = TRUE;
+ elide_empty_files = TRUE;
break;
default:
-k, --keep-files do not remove output files on errors\n\
-n, --digits=DIGITS use specified number of digits instead of 2\n\
-s, --quiet, --silent do not print counts of output file sizes\n\
- -z, --abandon-null-files remove empty output files\n\
+ -z, --elide-empty-files remove empty output files\n\
--help display this help and exit\n\
--version output version information and exit\n\
\n\
#include <getopt.h>
#include "system.h"
#include "version.h"
+#include "long-options.h"
char *xmalloc ();
char *xrealloc ();
{"j", required_argument, NULL, 'j'},
{"j1", required_argument, NULL, '1'},
{"j2", required_argument, NULL, '2'},
- {"help", no_argument, &show_help, 1},
- {"version", no_argument, &show_version, 1},
{NULL, 0, NULL, 0}
};
int optc, prev_optc = 0, nfiles, val;
program_name = argv[0];
+
+ parse_long_options (argc, argv, usage);
+
nfiles = 0;
print_pairables = 1;
prev_optc = optc;
}
- if (show_version)
- {
- printf ("%s\n", version_string);
- exit (0);
- }
-
- if (show_help)
- usage (0);
-
if (nfiles != 2)
usage (1);
/* Non-zero if we should recognize the pre-POSIX non-option arguments
that specified at most one file and optional arguments specifying
offset and pseudo-start address. */
-static int flag_compatibility;
+static int backward_compatibility;
/* Non-zero if an old-style `pseudo-address' was specified. */
static long int flag_pseudo_start;
{"output-duplicates", no_argument, NULL, 'v'},
/* non-POSIX options. */
- {"compatible", no_argument, NULL, 'C'},
+ {"backward-compatible", no_argument, NULL, 'B'},
{"strings", optional_argument, NULL, 's'},
{"width", optional_argument, NULL, 'w'},
{"help", no_argument, &show_help, 1},
printf ("\
\n\
-A, --address-radix RADIX decide how file offsets are printed\n\
- -C, --compatible trigger older syntax\n\
+ -C, --backward-compatible trigger older syntax\n\
-N, --read-bytes BYTES limit dump to BYTES input bytes per file\n\
-j, --skip-bytes BYTES skip BYTES input bytes first on each file\n\
-s, --strings [BYTES] output strings of at least BYTES graphic chars\n\
address_pad_len = 7;
flag_dump_strings = 0;
- while ((c = getopt_long (argc, argv, "abcCdfhilos::xw::A:j:N:t:v",
+ while ((c = getopt_long (argc, argv, "abBcdfhilos::xw::A:j:N:t:v",
long_options, (int *) 0))
!= EOF)
{
abbreviate_duplicate_blocks = 0;
break;
- case 'C':
- flag_compatibility = 1;
+ case 'B':
+ backward_compatibility = 1;
break;
/* The next several cases map the old, pre-POSIX format
n_files = argc - optind;
- /* If the --compatible option is used, there may be from 0 to 3
- remaining command line arguments; handle each case separately.
+ /* If the --backward-compatible option is used, there may be from
+ 0 to 3 remaining command line arguments; handle each case
+ separately.
od [file] [[+]offset[.][b] [[+]label[.][b]]]
The offset and pseudo_start have the same syntax. */
- if (flag_compatibility)
+ if (backward_compatibility)
{
long int offset;
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
-#include <signal.h>
#include "system.h"
#include "version.h"