From 87fa23e6417d7d1938b72e872d779ae7225a5aa4 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 12 Oct 1993 01:52:24 +0000 Subject: merge with 1.8.1b --- src/printf.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/printf.c') diff --git a/src/printf.c b/src/printf.c index 0c0da37fe..e1bd4d3ab 100644 --- a/src/printf.c +++ b/src/printf.c @@ -46,7 +46,10 @@ #include #include #include +#include + #include "system.h" +#include "version.h" #if !defined (isascii) || defined (STDC_HEADERS) #undef isascii @@ -68,6 +71,7 @@ unsigned long strtoul (); char *xmalloc (); void error (); +void parse_long_options (); static double xstrtod (); static int print_esc (); @@ -79,11 +83,19 @@ static void print_esc_char (); static void print_esc_string (); static void verify (); +/* The value to return to the calling program. */ +static int exit_status; + /* The name this program was run with. */ char *program_name; -/* The value to return to the calling program. */ -static int exit_status; +static void +usage () +{ + fprintf (stderr, "Usage: %s [{--help,--version}] format [argument...]\n", + program_name); + exit (1); +} void main (argc, argv) @@ -96,6 +108,8 @@ main (argc, argv) program_name = argv[0]; exit_status = 0; + parse_long_options (argc, argv, usage); + if (argc == 1) { fprintf (stderr, "Usage: %s format [argument...]\n", program_name); -- cgit v1.2.3-54-g00ecf