>From f8e1a2005ef5f23d9b381080944f1385a3b60e4b Mon Sep 17 00:00:00 2001 From: =?utf-8?q?P=C3=A1draig=20Brady?= Date: Fri, 12 Feb 2010 15:19:15 +0000 Subject: [PATCH] doc: fix inconsistent capitalization in --help output * src/base64.c (usage): Don't capitalize the first character in an --option description. * src/stdbuf.c (usage): Likewise. * src/truncate.c (usage): Likewise. * cfg.mk (sc_option_desc_uppercase): A new syntax check to stop this happening in future. * man/Makefile.am (sc_option_desc_uppercase): Ensure all man pages are generated and search for erroneous uppercase chars. * src/Makefile.am (sc_option_desc_uppercase): Ensure all commands are built so that all man pages can be generated. --- cfg.mk | 8 ++++++++ man/Makefile.am | 7 +++++++ src/Makefile.am | 5 +++++ src/base64.c | 6 +++--- src/stdbuf.c | 6 +++--- src/truncate.c | 2 +- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/cfg.mk b/cfg.mk index b5a21c3..dd6da25 100644 --- a/cfg.mk +++ b/cfg.mk @@ -171,6 +171,14 @@ ALL_RECURSIVE_TARGETS += sc_check-AUTHORS sc_check-AUTHORS: @$(MAKE) -C src $@ +# Option descriptions should not start with a capital letter +# One could grep source directly as follows: +# grep -E " {2,6}-.*[^.] [A-Z][a-z]" $$($(VC_LIST_EXCEPT) | grep '\.c$$') +# but that would miss descriptions not on the same line as the -option. +sc_option_desc_uppercase: + @$(MAKE) -C src $@ + @$(MAKE) -C man $@ + # Perl-based tests used to exec perl from a #!/bin/sh script. # Now they all start with #!/usr/bin/perl and the portability # infrastructure is in tests/Makefile.am. Make sure no old-style diff --git a/man/Makefile.am b/man/Makefile.am index 904b302..7cebbf1 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -173,6 +173,13 @@ mapped_name = `echo $*|sed 's/^install$$/ginstall/; s/^test$$/[/'` ;; \ esac +# Option descriptions should not start with a capital letter +.PHONY: sc_option_desc_uppercase +sc_option_desc_uppercase: $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT:%=%.1) + @grep '^\\fB\\-' -A1 *.1 | LC_ALL=C grep '\.1.[A-Z][a-z]' && \ + { echo 1>&2 '$(ME): found initial capitals in --help'; \ + exit 1; } || :; + distcheck-hook: check-x-vs-1 check-programs-vs-x # Sort in traditional ASCII order, regardless of the current locale; diff --git a/src/Makefile.am b/src/Makefile.am index c73f7dc..b6d5926 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -665,6 +665,11 @@ check-README: check-duplicate-no-install: tr $(AM_V_GEN)test -z "`echo '$(EXTRA_PROGRAMS)'| ./tr ' ' '\n' | uniq -d`" +# Ensure that all programs are built so that +# we can later check all man pages. +.PHONY: sc_option_desc_uppercase +sc_option_desc_uppercase: $(all_programs) + # Ensure that the list of programs and author names is accurate. # We need a UTF8 locale. If a lack of locale support or a missing # translation inhibits printing of UTF-8 names, just skip this test. diff --git a/src/base64.c b/src/base64.c index ce58f2f..34569ec 100644 --- a/src/base64.c +++ b/src/base64.c @@ -61,9 +61,9 @@ Usage: %s [OPTION]... [FILE]\n\ Base64 encode or decode FILE, or standard input, to standard output.\n\ \n"), program_name); fputs (_("\ - -d, --decode Decode data\n\ - -i, --ignore-garbage When decoding, ignore non-alphabet characters\n\ - -w, --wrap=COLS Wrap encoded lines after COLS character (default 76).\n\ + -d, --decode decode data\n\ + -i, --ignore-garbage when decoding, ignore non-alphabet characters\n\ + -w, --wrap=COLS wrap encoded lines after COLS character (default 76).\n\ Use 0 to disable line wrapping\n\ \n\ "), stdout); diff --git a/src/stdbuf.c b/src/stdbuf.c index de3f515..d9d6f17 100644 --- a/src/stdbuf.c +++ b/src/stdbuf.c @@ -98,9 +98,9 @@ Run COMMAND, with modified buffering operations for its standard streams.\n\ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (_("\ - -i, --input=MODE Adjust standard input stream buffering\n\ - -o, --output=MODE Adjust standard output stream buffering\n\ - -e, --error=MODE Adjust standard error stream buffering\n\ + -i, --input=MODE adjust standard input stream buffering\n\ + -o, --output=MODE adjust standard output stream buffering\n\ + -e, --error=MODE adjust standard error stream buffering\n\ "), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); diff --git a/src/truncate.c b/src/truncate.c index 5085d2c..70573cc 100644 --- a/src/truncate.c +++ b/src/truncate.c @@ -117,7 +117,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -c, --no-create do not create any files\n\ "), stdout); fputs (_("\ - -o, --io-blocks Treat SIZE as number of IO blocks instead of bytes\n\ + -o, --io-blocks treat SIZE as number of IO blocks instead of bytes\n\ "), stdout); fputs (_("\ -r, --reference=FILE use this FILE's size\n\ -- 1.6.2.5