tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Program usage message style



On 03/01, J. Lewis Muir wrote:
> 1. Should the "u" in "usage:" be uppercase?

For reference, in the netbsd-6 branch, about 66% of the usage messages
in .c files use a lowercase "u" if external and gnu are excluded:

===
$ cd /usr/src
$ find . -name '*.c' ! -path './external/*' ! -path './gnu/*' -exec egrep -H -m 1 '"[Uu]sage:' '{}' ';' | tee /tmp/netbsd-6-usage.txt
$ wc -l /tmp/netbsd-6-usage.txt
     792 /tmp/netbsd-6-usage.txt
$ fgrep '"usage:' /tmp/netbsd-6-usage.txt | wc -l
     527
$ echo 'scale=2; 527 / 792' | bc
.66
===

If nothing is excluded, it's about 60%:

===
$ cd /usr/src
$ find . -name '*.c' -exec egrep -H -m 1 '"[Uu]sage:' '{}' ';' | tee /tmp/netbsd-6-usage.txt
$ wc -l /tmp/netbsd-6-usage.txt
    1217 /tmp/netbsd-6-usage.txt
$ fgrep '"usage:' /tmp/netbsd-6-usage.txt | wc -l
     736
$ echo 'scale=2; 736 / 1217' | bc
.60
===

Lewis


Home | Main Index | Thread Index | Old Index