--- hostinfo/Makefile +++ hostinfo/Makefile @@ -31,13 +31,13 @@ bindir = $(prefix)/bin CC = gcc OPTFLAGS = -O2 -WARNFLAGS = -Wall -W -ansi -pedantic +WARNFLAGS = -Wall -W -Werror MISCFLAGS = -DNAME=\"$(NAME)\" -DVERSION=\"$(VERSION)\" -DDATE=\"$(DATE)\" CFLAGS = $(OPTFLAGS) $(WARNFLAGS) $(MISCFLAGS) LDFLAGS = INSTALL = install -INSTALL_BIN = $(INSTALL) -m 0755 -s +INSTALL_BIN = $(INSTALL) -m 0755 INSTALL_MAN = $(INSTALL) -m 0444 INSTALL_SCRIPT = $(INSTALL) -m 0755 INSTALL_DATA = $(INSTALL) -m 0644 --- /dev/null +++ hostinfo/hostinfo.1.inc @@ -0,0 +1,2 @@ +[NAME] +\fBhostinfo\fR \- utility for looking up hostnames and IP addresses. --- hostinfo/hostinfo.c +++ hostinfo/hostinfo.c @@ -22,6 +22,7 @@ #include #include +#include #include /* This is arbitrarily dependent on IPv4 to be right. */ @@ -47,10 +48,7 @@ static int show_first_only = 0; static int print_only = 0; static char *usage_info = -"Usage:\n" -" %s [-a] [-n] [-l] [-1] [-{x|o|d}] [-{X|O|D|N}] [-p] [...]\n" -" %s --help\n" -" %s --version\n" +"Usage: %s [-a] [-n] [-l] [-1] [-{x|o|d}] [-{X|O|D|N}] [-p] [...]\n" "\n" "Find and print name, IP address(es), and aliases (if any) of each\n" "specified host. By default, first try to interpret as a\n" @@ -131,7 +129,8 @@ NAME " prints a separate record for each address. Use the -1 option\n" ; static char *copyright_info = -"by Jim Knoble \n" +"Written by Jim Knoble \n" +"\n" "Copyright (C) 1998,1999,2000 Jim Knoble\n" "\n" "THIS SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n" @@ -150,14 +149,13 @@ static char *copyright_info = ; void print_help() { - printf(usage_info, prog_name, prog_name, prog_name); - exit(1); + printf(usage_info, prog_name, prog_name, prog_name, prog_name); + exit(0); } void print_version() { - printf("%s version %s (%s)\n", NAME, VERSION, DATE); - printf(copyright_info); - exit(2); + printf("%s version %s (%s)\n%s", NAME, VERSION, DATE, copyright_info); + exit(0); } int check_conflict2(char **argv, int argi1, int argi2) {