summaryrefslogtreecommitdiff
path: root/src/ptx.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-01-02 19:35:18 +0000
committerJim Meyering <jim@meyering.net>1999-01-02 19:35:18 +0000
commit501ee2ebd61081332096d91ca312ea50bb7526e4 (patch)
tree6fe06731bce3db1f00c04da1d3e8115d86048e74 /src/ptx.c
parente159d72704a14e06c500c28d2eb21d35504c919c (diff)
downloadcoreutils-501ee2ebd61081332096d91ca312ea50bb7526e4.tar.xz
(format_vals): New array.
(main): Use XARGMATCH in place of argmatch.
Diffstat (limited to 'src/ptx.c')
-rw-r--r--src/ptx.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/ptx.c b/src/ptx.c
index c83b745fc..b086cb925 100644
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -1,5 +1,5 @@
/* Permuted index for GNU, with keywords in their context.
- Copyright © 1990, 1991, 1993, 1998 Free Software Foundation, Inc.
+ Copyright © 1990, 1991, 1993, 1998, 1999 Free Software Foundation, Inc.
François Pinard <pinard@iro.umontreal.ca>, 1988.
This program is free software; you can redistribute it and/or modify
@@ -1944,6 +1944,11 @@ static char const* const format_args[] =
"roff", "tex", 0
};
+static enum Format const format_vals[] =
+{
+ ROFF_FORMAT, TEX_FORMAT
+};
+
int
main (int argc, char *const argv[])
{
@@ -2059,19 +2064,8 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"),
break;
case 10:
- switch (argmatch (optarg, format_args))
- {
- default:
- usage (EXIT_FAILURE);
-
- case 0:
- output_format = ROFF_FORMAT;
- break;
-
- case 1:
- output_format = TEX_FORMAT;
- break;
- }
+ XARGMATCH (&output_format, "--format", optarg,
+ format_args, format_vals, usage (1));
}
}