[BACK]Return to style CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / misc

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/share/misc/style between version 1.36 and 1.37

version 1.36, 2005/08/25 17:51:58 version 1.37, 2006/02/25 11:07:19
Line 194  main(int argc, char *argv[])
Line 194  main(int argc, char *argv[])
         setprogname(argv[0]);          setprogname(argv[0]);
   
         /*          /*
          * For consistency, getopt should be used to parse options.  Options           * For consistency, getopt should be used to parse options.
          * should be sorted in the getopt call and the switch statement, unless           * Options should be sorted in the getopt call and the switch
          * parts of the switch cascade.  Elements in a switch statement that           * statement, unless parts of the switch cascade.  For the
          * cascade should have a FALLTHROUGH comment.  Numerical arguments           * sorting order, see the usage() example below.  Don't forget
          * should be checked for accuracy.  Code that cannot be reached should           * to add option descriptions to the usage and the manpage.
          * have a NOTREACHED comment.           * Elements in a switch statement that cascade should have a
            * FALLTHROUGH comment.  Numerical arguments should be checked
            * for accuracy.  Code that cannot be reached should have a
            * NOTREACHED comment.
          */           */
         while ((ch = getopt(argc, argv, "abn")) != -1) {          while ((ch = getopt(argc, argv, "abn")) != -1) {
                 switch (ch) {           /* Indent the switch. */                  switch (ch) {           /* Indent the switch. */
Line 416  usage(void)
Line 419  usage(void)
          * Use snprintf(3) or strlcpy(3)/strlcat(3) instead of sprintf(3);           * Use snprintf(3) or strlcpy(3)/strlcat(3) instead of sprintf(3);
          * again to avoid stupid bugs.           * again to avoid stupid bugs.
          *           *
          * Usage statements should look like the manual pages.  Options w/o           * Usage statements should look like the manual pages.
          * operands come first, in alphabetical order inside a single set of           * Options w/o operands come first, in alphabetical order
          * braces.  Followed by options with operands, in alphabetical order,           * inside a single set of braces, upper case before lower case
          * each in braces.  Followed by required arguments in the order they           * (AaBbCc...).  Next are options with operands, in the same
          * are specified, followed by optional arguments in the order they           * order, each in braces.  Then required arguments in the
          * are specified.  A bar (`|') separates either/or options/arguments,           * order they are specified, followed by optional arguments in
          * and multiple options/arguments which are specified together are           * the order they are specified.  A bar (`|') separates
          * placed in a single set of braces.           * either/or options/arguments, and multiple options/arguments
            * which are specified together are placed in a single set of
            * braces.
          *           *
          * Use getprogname() instead of hardcoding the program name.           * Use getprogname() instead of hardcoding the program name.
          *           *
          * "usage: f [-ade] [-b b_arg] [-m m_arg] req1 req2 [opt1 [opt2]]\n"           * "usage: f [-aDde] [-b b_arg] [-m m_arg] req1 req2 [opt1 [opt2]]\n"
          * "usage: f [-a | -b] [-c [-de] [-n number]]\n"           * "usage: f [-a | -b] [-c [-de] [-n number]]\n"
          */           */
         (void)fprintf(stderr, "usage: %s [-ab]\n", getprogname());          (void)fprintf(stderr, "usage: %s [-ab]\n", getprogname());

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

CVSweb <webmaster@jp.NetBSD.org>