On Mon, Jun 15, 2015 at 11:42:10AM +0100, Nicholas Marriott wrote:
> 
> this seems fine to me
>

Ping ...
 
> 
> On Sun, Jun 14, 2015 at 10:38:40PM +0200, Fritjof Bornebusch wrote:
> > Hi tech@,
> > 
> > most of the tools implements the *usage* function above the *main* function.
> > This patch makes it more consistent to these tools and where the different 
> > *usage*
> > functions are implemented in rcs in general.
> > 
> > Any comments?
> > 
> > Regards,
> > --F.
> > 
> > 
> > Index: co.c
> > ===================================================================
> > RCS file: /cvs/src/usr.bin/rcs/co.c,v
> > retrieving revision 1.121
> > diff -u -p -r1.121 co.c
> > --- co.c    13 Jun 2015 20:15:21 -0000      1.121
> > +++ co.c    14 Jun 2015 20:21:41 -0000
> > @@ -43,6 +43,17 @@ static void      checkout_err_nobranch(RCSFIL
> >      const char *, int);
> >  static int checkout_file_has_diffs(RCSFILE *, RCSNUM *, const char *);
> >  
> > +__dead void
> > +checkout_usage(void)
> > +{
> > +   fprintf(stderr,
> > +       "usage: co [-TV] [-ddate] [-f[rev]] [-I[rev]] [-kmode] [-l[rev]]\n"
> > +       "          [-M[rev]] [-p[rev]] [-q[rev]] [-r[rev]] [-sstate]\n"
> > +       "          [-u[rev]] [-w[user]] [-xsuffixes] [-ztz] file ...\n");
> > +   
> > +   exit(1);
> > +}
> > +
> >  int
> >  checkout_main(int argc, char **argv)
> >  {
> > @@ -216,17 +227,6 @@ checkout_main(int argc, char **argv)
> >     }
> >  
> >     return (ret);
> > -}
> > -
> > -__dead void
> > -checkout_usage(void)
> > -{
> > -   fprintf(stderr,
> > -       "usage: co [-TV] [-ddate] [-f[rev]] [-I[rev]] [-kmode] [-l[rev]]\n"
> > -       "          [-M[rev]] [-p[rev]] [-q[rev]] [-r[rev]] [-sstate]\n"
> > -       "          [-u[rev]] [-w[user]] [-xsuffixes] [-ztz] file ...\n");
> > -   
> > -   exit(1);
> >  }
> >  
> >  /*
> > Index: ident.c
> > ===================================================================
> > RCS file: /cvs/src/usr.bin/rcs/ident.c,v
> > retrieving revision 1.30
> > diff -u -p -r1.30 ident.c
> > --- ident.c 2 Oct 2014 06:23:15 -0000       1.30
> > +++ ident.c 14 Jun 2015 20:21:41 -0000
> > @@ -41,6 +41,14 @@ static int flags = 0;
> >  static void        ident_file(const char *, FILE *);
> >  static void        ident_line(FILE *);
> >  
> > +__dead void
> > +ident_usage(void)
> > +{
> > +   fprintf(stderr, "usage: ident [-qV] [file ...]\n");
> > +   
> > +   exit(1);
> > +}
> > +
> >  int
> >  ident_main(int argc, char **argv)
> >  {
> > @@ -158,12 +166,4 @@ ident_line(FILE *fp)
> >  out:
> >     if (bp != NULL)
> >             buf_free(bp);
> > -}
> > -
> > -__dead void
> > -ident_usage(void)
> > -{
> > -   fprintf(stderr, "usage: ident [-qV] [file ...]\n");
> > -   
> > -   exit(1);
> >  }
> > Index: merge.c
> > ===================================================================
> > RCS file: /cvs/src/usr.bin/rcs/merge.c,v
> > retrieving revision 1.9
> > diff -u -p -r1.9 merge.c
> > --- merge.c 10 Oct 2014 08:15:25 -0000      1.9
> > +++ merge.c 14 Jun 2015 20:21:41 -0000
> > @@ -32,6 +32,15 @@
> >  #include "rcsprog.h"
> >  #include "diff.h"
> >  
> > +__dead void
> > +merge_usage(void)
> > +{
> > +   fprintf(stderr,
> > +       "usage: merge [-EepqV] [-L label] file1 file2 file3\n");
> > +
> > +   exit(D_ERROR);
> > +}
> > +
> >  int
> >  merge_main(int argc, char **argv)
> >  {
> > @@ -108,13 +117,4 @@ merge_main(int argc, char **argv)
> >     buf_free(bp);
> >  
> >     return (status);
> > -}
> > -
> > -__dead void
> > -merge_usage(void)
> > -{
> > -   (void)fprintf(stderr,
> > -       "usage: merge [-EepqV] [-L label] file1 file2 file3\n");
> > -
> > -   exit(D_ERROR);
> >  }
> > Index: rcsclean.c
> > ===================================================================
> > RCS file: /cvs/src/usr.bin/rcs/rcsclean.c,v
> > retrieving revision 1.54
> > diff -u -p -r1.54 rcsclean.c
> > --- rcsclean.c      16 Jan 2015 06:40:11 -0000      1.54
> > +++ rcsclean.c      14 Jun 2015 20:21:41 -0000
> > @@ -43,6 +43,16 @@ static int uflag = 0;
> >  static int flags = 0;
> >  static char *locker = NULL;
> >  
> > +__dead void
> > +rcsclean_usage(void)
> > +{
> > +   fprintf(stderr,
> > +       "usage: rcsclean [-TV] [-kmode] [-n[rev]] [-q[rev]] [-r[rev]]\n"
> > +       "                [-u[rev]] [-xsuffixes] [-ztz] [file ...]\n");
> > +
> > +   exit(1);
> > +}
> > +
> >  int
> >  rcsclean_main(int argc, char **argv)
> >  {
> > @@ -116,16 +126,6 @@ rcsclean_main(int argc, char **argv)
> >                     rcsclean_file(argv[i], rev_str);
> >  
> >     return (0);
> > -}
> > -
> > -__dead void
> > -rcsclean_usage(void)
> > -{
> > -   fprintf(stderr,
> > -       "usage: rcsclean [-TV] [-kmode] [-n[rev]] [-q[rev]] [-r[rev]]\n"
> > -       "                [-u[rev]] [-xsuffixes] [-ztz] [file ...]\n");
> > -
> > -   exit(1);
> >  }
> >  
> >  static void
> > Index: rcsdiff.c
> > ===================================================================
> > RCS file: /cvs/src/usr.bin/rcs/rcsdiff.c,v
> > retrieving revision 1.83
> > diff -u -p -r1.83 rcsdiff.c
> > --- rcsdiff.c       13 Jun 2015 20:15:21 -0000      1.83
> > +++ rcsdiff.c       14 Jun 2015 20:21:41 -0000
> > @@ -45,6 +45,16 @@ static int quiet;
> >  static int kflag = RCS_KWEXP_ERR;
> >  static char *diff_ignore_pats;
> >  
> > +__dead void
> > +rcsdiff_usage(void)
> > +{
> > +   fprintf(stderr,
> > +       "usage: rcsdiff [-cnquV] [-kmode] [-rrev] [-xsuffixes] [-ztz]\n"
> > +       "               [diff_options] file ...\n");
> > +
> > +   exit(D_ERROR);
> > +}
> > +
> >  int
> >  rcsdiff_main(int argc, char **argv)
> >  {
> > @@ -262,16 +272,6 @@ rcsdiff_main(int argc, char **argv)
> >     }
> >  
> >     return (status);
> > -}
> > -
> > -__dead void
> > -rcsdiff_usage(void)
> > -{
> > -   fprintf(stderr,
> > -       "usage: rcsdiff [-cnquV] [-kmode] [-rrev] [-xsuffixes] [-ztz]\n"
> > -       "               [diff_options] file ...\n");
> > -
> > -   exit(D_ERROR);
> >  }
> >  
> >  static int
> > Index: rcsmerge.c
> > ===================================================================
> > RCS file: /cvs/src/usr.bin/rcs/rcsmerge.c,v
> > retrieving revision 1.55
> > diff -u -p -r1.55 rcsmerge.c
> > --- rcsmerge.c      16 Jan 2015 06:40:11 -0000      1.55
> > +++ rcsmerge.c      14 Jun 2015 20:21:41 -0000
> > @@ -33,6 +33,16 @@
> >  #include "rcsprog.h"
> >  #include "diff.h"
> >  
> > +__dead void
> > +rcsmerge_usage(void)
> > +{
> > +   fprintf(stderr,
> > +       "usage: rcsmerge [-EV] [-kmode] [-p[rev]] [-q[rev]]\n"
> > +       "                [-xsuffixes] [-ztz] -rrev file ...\n");
> > +
> > +   exit(D_ERROR);
> > +}
> > +
> >  int
> >  rcsmerge_main(int argc, char **argv)
> >  {
> > @@ -180,14 +190,4 @@ out:
> >             rcsnum_free(rev2);
> >  
> >     return (status);
> > -}
> > -
> > -__dead void
> > -rcsmerge_usage(void)
> > -{
> > -   fprintf(stderr,
> > -       "usage: rcsmerge [-EV] [-kmode] [-p[rev]] [-q[rev]]\n"
> > -       "                [-xsuffixes] [-ztz] -rrev file ...\n");
> > -
> > -   exit(D_ERROR);
> >  }
> 

Reply via email to