Date: Tue, 4 May 2010 19:17:49 +1000 From: Peter Jeremy <peterjeremy@acm.org> To: freebsd-arch@freebsd.org Subject: Style question: writing multi-line usage messages Message-ID: <20100504091749.GA58464@server.vk2pj.dyndns.org>
next in thread | raw e-mail | index | archive | help
--YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I would appreciate some input on the preferred style for writing multi-line usage messages. Should: 1) printf() print a series of 1-line strings 2) should string gluing be used to turn multiple strings into one for print= ing 3) should continuation lines be used to create a single string I can't see anything in style(9) to cover this. Variants of the tunefs(8) usage() function follow as examples: void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", "usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]", " [-J enable | disable] [-j enable | disable]",=20 " [-L volname] [-l enable | disable] [-m minfree]", " [-N enable | disable] [-n enable | disable]", " [-o space | time] [-p] [-S size] [-s avgfpdir]", " special | filesystem"); exit(2); } void usage(void) { fprintf(stderr, "usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]\n" " [-J enable | disable] [-j enable | disable]\n" " [-L volname] [-l enable | disable] [-m minfree]\n" " [-N enable | disable] [-n enable | disable]\n" " [-o space | time] [-p] [-S size] [-s avgfpdir]\n" " special | filesystem\n"); exit(2); } void usage(void) { fprintf(stderr, "usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]\n\ [-J enable | disable] [-j enable | disable]\n\ [-L volname] [-l enable | disable] [-m minfree]\n\ [-N enable | disable] [-n enable | disable]\n\ [-o space | time] [-p] [-S size] [-s avgfpdir]\n\ special | filesystem\n"); exit(2); } --=20 Peter Jeremy --YZ5djTAD1cGYuMQK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkvf5j0ACgkQ/opHv/APuIeH5wCfd7hzjrnV+K7E4W52xILuvmmx 9MQAoLLSIT/LSRpJ/tSR3lVuBj1FqfdG =VVAd -----END PGP SIGNATURE----- --YZ5djTAD1cGYuMQK--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100504091749.GA58464>