From: jmc Date: Tue, 22 Jun 2021 20:19:28 +0000 (+0000) Subject: reduce verbosity in usage and make it match SYNOPSIS; X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=50348693265b6076bf70f8d8b050d9fbbbca93a2;p=openbsd reduce verbosity in usage and make it match SYNOPSIS; i reformatted it to match 80w, and removed two functions that had been used to populate usage: getdistoptlist and msgprusage; ok millert --- diff --git a/usr.bin/rdist/client.h b/usr.bin/rdist/client.h index 2242de7f53a..1469092dfa8 100644 --- a/usr.bin/rdist/client.h +++ b/usr.bin/rdist/client.h @@ -1,4 +1,4 @@ -/* $OpenBSD: client.h,v 1.3 2017/08/30 07:42:52 otto Exp $ */ +/* $OpenBSD: client.h,v 1.4 2021/06/22 20:19:28 jmc Exp $ */ #ifndef __CLIENT_H__ #define __CLIENT_H__ @@ -161,7 +161,6 @@ int install(char *, char *, int, int , opt_t); /* distopt.c */ int parsedistopts(char *, opt_t *, int); -char *getdistoptlist(void); char *getondistoptlist(opt_t); /* docmd.c */ diff --git a/usr.bin/rdist/defs.h b/usr.bin/rdist/defs.h index e63ee3d801c..3b0688e4071 100644 --- a/usr.bin/rdist/defs.h +++ b/usr.bin/rdist/defs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: defs.h,v 1.38 2018/09/21 19:00:45 millert Exp $ */ +/* $OpenBSD: defs.h,v 1.39 2021/06/22 20:19:28 jmc Exp $ */ #ifndef __DEFS_H__ #define __DEFS_H__ @@ -206,7 +206,6 @@ char *xbasename(char *); char *searchpath(char *); /* message.c */ -void msgprusage(void); void msgprconfig(void); char *msgparseopts(char *, int); void checkhostname(void); diff --git a/usr.bin/rdist/distopt.c b/usr.bin/rdist/distopt.c index 9604ee83412..3f0b88a240a 100644 --- a/usr.bin/rdist/distopt.c +++ b/usr.bin/rdist/distopt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: distopt.c,v 1.13 2015/01/20 09:00:16 guenther Exp $ */ +/* $OpenBSD: distopt.c,v 1.14 2021/06/22 20:19:28 jmc Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -133,27 +133,6 @@ parsedistopts(char *str, opt_t *optptr, int doerrs) return(nerrs); } -/* - * Get a list of the Distfile Option Entries. - */ -char * -getdistoptlist(void) -{ - int i; - static char buf[1024]; - - for (i = 0, buf[0] = CNULL; distoptinfo[i].do_name; ++i) { - if (buf[0] == CNULL) - (void) strlcpy(buf, distoptinfo[i].do_name, sizeof buf); - else { - (void) strlcat(buf, ",", sizeof buf); - (void) strlcat(buf, distoptinfo[i].do_name, sizeof buf); - } - } - - return(buf); -} - /* * Get a list of the Distfile Option Entries for each enabled * value in "opts". diff --git a/usr.bin/rdist/message.c b/usr.bin/rdist/message.c index eff150374f3..8119141f118 100644 --- a/usr.bin/rdist/message.c +++ b/usr.bin/rdist/message.c @@ -1,4 +1,4 @@ -/* $OpenBSD: message.c,v 1.29 2019/06/28 05:35:35 deraadt Exp $ */ +/* $OpenBSD: message.c,v 1.30 2021/06/22 20:19:28 jmc Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -117,30 +117,6 @@ static void _debugmsg(int, char *); static void _error(const char *); static void _fatalerr(const char *); -/* - * Print message logging usage message - */ -void -msgprusage(void) -{ - int i, x; - - (void) fprintf(stderr, "\nWhere is of form\n"); - (void) fprintf(stderr, - "\t=,,...:=,...\n"); - - (void) fprintf(stderr, "Valid names:"); - - for (i = 0; msgfacility[i].mf_name; ++i) - (void) fprintf(stderr, " %s", msgfacility[i].mf_name); - - (void) fprintf(stderr, "\nValid names:"); - for (x = 0; msgtypes[x].mt_name; ++x) - (void) fprintf(stderr, " %s", msgtypes[x].mt_name); - - (void) fprintf(stderr, "\n"); -} - /* * Print enabled message logging info */ diff --git a/usr.bin/rdist/rdist.c b/usr.bin/rdist/rdist.c index ffa692b2f82..4003ff6ee16 100644 --- a/usr.bin/rdist/rdist.c +++ b/usr.bin/rdist/rdist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rdist.c,v 1.31 2017/07/09 14:04:50 espie Exp $ */ +/* $OpenBSD: rdist.c,v 1.32 2021/06/22 20:19:28 jmc Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -337,19 +337,13 @@ usage(void) extern char *__progname; (void) fprintf(stderr, - "usage: %s [-DFnV] [-A num] [-a num] " - "[-c mini_distfile]\n" - "\t[-d var=value] [-f distfile] [-L remote_logopts] " - "[-l local_logopts]\n" - "\t[-M maxproc] [-m host] [-o distopts] [-P rsh-path] " - "[-p rdistd-path]\n" - "\t[-t timeout] [name ...]\n", __progname); - - - (void) fprintf(stderr, "\nThe values for are:\n\t%s\n", - getdistoptlist()); - - msgprusage(); + "usage: %s [-DFnV] [-A num] [-a num] [-c mini_distfile]" + " [-d var=value]\n" + "\t[-f distfile] [-L remote_logopts] [-l local_logopts]" + " [-M maxproc]\n" + "\t[-m host] [-o distopts] [-P rsh-path] [-p rdistd-path]" + " [-t timeout]\n" + "\t[name ...]\n", __progname); exit(1); }