jcs's openbsd hax
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

jmc 50348693 889c8aec

+12 -65
+1 -2
usr.bin/rdist/client.h
··· 1 - /* $OpenBSD: client.h,v 1.3 2017/08/30 07:42:52 otto Exp $ */ 1 + /* $OpenBSD: client.h,v 1.4 2021/06/22 20:19:28 jmc Exp $ */ 2 2 3 3 #ifndef __CLIENT_H__ 4 4 #define __CLIENT_H__ ··· 161 161 162 162 /* distopt.c */ 163 163 int parsedistopts(char *, opt_t *, int); 164 - char *getdistoptlist(void); 165 164 char *getondistoptlist(opt_t); 166 165 167 166 /* docmd.c */
+1 -2
usr.bin/rdist/defs.h
··· 1 - /* $OpenBSD: defs.h,v 1.38 2018/09/21 19:00:45 millert Exp $ */ 1 + /* $OpenBSD: defs.h,v 1.39 2021/06/22 20:19:28 jmc Exp $ */ 2 2 3 3 #ifndef __DEFS_H__ 4 4 #define __DEFS_H__ ··· 206 206 char *searchpath(char *); 207 207 208 208 /* message.c */ 209 - void msgprusage(void); 210 209 void msgprconfig(void); 211 210 char *msgparseopts(char *, int); 212 211 void checkhostname(void);
+1 -22
usr.bin/rdist/distopt.c
··· 1 - /* $OpenBSD: distopt.c,v 1.13 2015/01/20 09:00:16 guenther Exp $ */ 1 + /* $OpenBSD: distopt.c,v 1.14 2021/06/22 20:19:28 jmc Exp $ */ 2 2 3 3 /* 4 4 * Copyright (c) 1983 Regents of the University of California. ··· 131 131 (void) free(string); 132 132 133 133 return(nerrs); 134 - } 135 - 136 - /* 137 - * Get a list of the Distfile Option Entries. 138 - */ 139 - char * 140 - getdistoptlist(void) 141 - { 142 - int i; 143 - static char buf[1024]; 144 - 145 - for (i = 0, buf[0] = CNULL; distoptinfo[i].do_name; ++i) { 146 - if (buf[0] == CNULL) 147 - (void) strlcpy(buf, distoptinfo[i].do_name, sizeof buf); 148 - else { 149 - (void) strlcat(buf, ",", sizeof buf); 150 - (void) strlcat(buf, distoptinfo[i].do_name, sizeof buf); 151 - } 152 - } 153 - 154 - return(buf); 155 134 } 156 135 157 136 /*
+1 -25
usr.bin/rdist/message.c
··· 1 - /* $OpenBSD: message.c,v 1.29 2019/06/28 05:35:35 deraadt Exp $ */ 1 + /* $OpenBSD: message.c,v 1.30 2021/06/22 20:19:28 jmc Exp $ */ 2 2 3 3 /* 4 4 * Copyright (c) 1983 Regents of the University of California. ··· 116 116 static void _debugmsg(int, char *); 117 117 static void _error(const char *); 118 118 static void _fatalerr(const char *); 119 - 120 - /* 121 - * Print message logging usage message 122 - */ 123 - void 124 - msgprusage(void) 125 - { 126 - int i, x; 127 - 128 - (void) fprintf(stderr, "\nWhere <msgopt> is of form\n"); 129 - (void) fprintf(stderr, 130 - "\t<facility1>=<type1>,<type2>,...:<facility2>=<type1>,<type2>...\n"); 131 - 132 - (void) fprintf(stderr, "Valid <facility> names:"); 133 - 134 - for (i = 0; msgfacility[i].mf_name; ++i) 135 - (void) fprintf(stderr, " %s", msgfacility[i].mf_name); 136 - 137 - (void) fprintf(stderr, "\nValid <type> names:"); 138 - for (x = 0; msgtypes[x].mt_name; ++x) 139 - (void) fprintf(stderr, " %s", msgtypes[x].mt_name); 140 - 141 - (void) fprintf(stderr, "\n"); 142 - } 143 119 144 120 /* 145 121 * Print enabled message logging info
+8 -14
usr.bin/rdist/rdist.c
··· 1 - /* $OpenBSD: rdist.c,v 1.31 2017/07/09 14:04:50 espie Exp $ */ 1 + /* $OpenBSD: rdist.c,v 1.32 2021/06/22 20:19:28 jmc Exp $ */ 2 2 3 3 /* 4 4 * Copyright (c) 1983 Regents of the University of California. ··· 337 337 extern char *__progname; 338 338 339 339 (void) fprintf(stderr, 340 - "usage: %s [-DFnV] [-A num] [-a num] " 341 - "[-c mini_distfile]\n" 342 - "\t[-d var=value] [-f distfile] [-L remote_logopts] " 343 - "[-l local_logopts]\n" 344 - "\t[-M maxproc] [-m host] [-o distopts] [-P rsh-path] " 345 - "[-p rdistd-path]\n" 346 - "\t[-t timeout] [name ...]\n", __progname); 347 - 348 - 349 - (void) fprintf(stderr, "\nThe values for <distopts> are:\n\t%s\n", 350 - getdistoptlist()); 351 - 352 - msgprusage(); 340 + "usage: %s [-DFnV] [-A num] [-a num] [-c mini_distfile]" 341 + " [-d var=value]\n" 342 + "\t[-f distfile] [-L remote_logopts] [-l local_logopts]" 343 + " [-M maxproc]\n" 344 + "\t[-m host] [-o distopts] [-P rsh-path] [-p rdistd-path]" 345 + " [-t timeout]\n" 346 + "\t[name ...]\n", __progname); 353 347 354 348 exit(1); 355 349 }