simple diff for lndir.{1,c} to use same terminology as ln(1)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

simple diff for lndir.{1,c} to use same terminology as ln(1)

jared r r spiegel
  noticed that ln uses 'sourcefile' and 'targetfile', but lndir
  uses 'fromdir' and 'todir'.  in case it is desired that lndir
  use similar terms to ln (s/fromdir/sourcedir/g; s/todir/targetdir/g),
  here is diff for lndir.1 and lndir.c (the usage section):

Index: usr.bin/lndir/lndir.1
===================================================================
RCS file: /cvs/src/usr.bin/lndir/lndir.1,v
retrieving revision 1.21
diff -u -r1.21 lndir.1
--- usr.bin/lndir/lndir.1 6 Oct 2005 15:28:32 -0000 1.21
+++ usr.bin/lndir/lndir.1 3 Sep 2006 02:21:33 -0000
@@ -61,19 +61,19 @@
 .Nm lndir
 .Op Fl is
 .Op Fl e Ar exceptfile
-.Ar fromdir
-.Op Ar todir
+.Ar sourcedir
+.Op Ar targetdir
 .Sh DESCRIPTION
 The
 .Nm
 program makes a shadow copy
-.Ar todir
+.Ar targetdir
 of a directory tree
-.Ar fromdir ,
+.Ar sourcedir ,
 except that the shadow is not
 populated with real files but instead with symbolic links pointing at
 the real files in the
-.Ar fromdir
+.Ar sourcedir
 directory tree.
 This is usually useful for maintaining source code for
 different machine architectures.
@@ -92,14 +92,14 @@
 to the shadow directory and recompile away.
 .Pp
 The
-.Ar todir
+.Ar targetdir
 argument is optional and defaults to the current directory.
 The
-.Ar fromdir
+.Ar sourcedir
 argument may be relative (e.g.\&
 .Pa ../src )
 and is relative to
-.Ar todir
+.Ar targetdir
 (not the current directory).
 .Pp
 If you add files, simply run
@@ -134,23 +134,23 @@
 .El
 .It Fl i
 If a file in
-.Ar fromdir
+.Ar sourcedir
 is a symbolic link,
 .Nm
 will make the same link in
-.Ar todir
+.Ar targetdir
 rather than making a link back to the (symbolic link) entry in
-.Ar fromdir .
+.Ar sourcedir .
 The
 .Fl i
 flag changes that behavior,
 i.e. it causes the program to not treat symbolic links in
-.Ar fromdir
+.Ar sourcedir
 specially.
 The link created in
-.Ar todir
+.Ar targetdir
 will point back to the corresponding (symbolic link) file in
-.Ar fromdir .
+.Ar sourcedir .
 If the link is to a directory, this is almost certainly the wrong thing.
 .Pp
 This option exists mostly to emulate the behavior the C version of
@@ -195,10 +195,10 @@
 .Pp
 To clear out all files before you can relink
 (if
-.Ar fromdir
+.Ar sourcedir
 moved, for instance):
 .Bd -literal -offset indent
-$ find todir -type l -print0 | xargs -0 -r rm
+$ find targetdir -type l -print0 | xargs -0 -r rm
 .Ed
 .Pp
 Find all files that are not directories:
Index: usr.bin/lndir/lndir.c
===================================================================
RCS file: /cvs/src/usr.bin/lndir/lndir.c,v
retrieving revision 1.17
diff -u -r1.17 lndir.c
--- usr.bin/lndir/lndir.c 4 Oct 2005 19:30:00 -0000 1.17
+++ usr.bin/lndir/lndir.c 3 Sep 2006 02:21:33 -0000
@@ -310,7 +310,7 @@
 void
 usage(void)
 {
- (void)fprintf(stderr, "usage: %s [-is] [-e exceptfile] fromdir [todir]\n",
+ (void)fprintf(stderr, "usage: %s [-is] [-e exceptfile] sourcedir [targetdir]\n",
     __progname);
  exit(1);
 }

Reply | Threaded
Open this post in threaded view
|

Re: simple diff for lndir.{1,c} to use same terminology as ln(1)

Jason McIntyre-2
On Sat, Sep 02, 2006 at 10:24:30PM -0400, jared r r spiegel wrote:
>   noticed that ln uses 'sourcefile' and 'targetfile', but lndir
>   uses 'fromdir' and 'todir'.  in case it is desired that lndir
>   use similar terms to ln (s/fromdir/sourcedir/g; s/todir/targetdir/g),
>   here is diff for lndir.1 and lndir.c (the usage section):
>

unless there is a good reason to prefer one version over the other, i
don;t see a need for this.

jmc

> Index: usr.bin/lndir/lndir.1
> ===================================================================
> RCS file: /cvs/src/usr.bin/lndir/lndir.1,v
> retrieving revision 1.21
> diff -u -r1.21 lndir.1
> --- usr.bin/lndir/lndir.1 6 Oct 2005 15:28:32 -0000 1.21
> +++ usr.bin/lndir/lndir.1 3 Sep 2006 02:21:33 -0000
> @@ -61,19 +61,19 @@
>  .Nm lndir
>  .Op Fl is
>  .Op Fl e Ar exceptfile
> -.Ar fromdir
> -.Op Ar todir
> +.Ar sourcedir
> +.Op Ar targetdir
>  .Sh DESCRIPTION
>  The
>  .Nm
>  program makes a shadow copy
> -.Ar todir
> +.Ar targetdir
>  of a directory tree
> -.Ar fromdir ,
> +.Ar sourcedir ,
>  except that the shadow is not
>  populated with real files but instead with symbolic links pointing at
>  the real files in the
> -.Ar fromdir
> +.Ar sourcedir
>  directory tree.
>  This is usually useful for maintaining source code for
>  different machine architectures.
> @@ -92,14 +92,14 @@
>  to the shadow directory and recompile away.
>  .Pp
>  The
> -.Ar todir
> +.Ar targetdir
>  argument is optional and defaults to the current directory.
>  The
> -.Ar fromdir
> +.Ar sourcedir
>  argument may be relative (e.g.\&
>  .Pa ../src )
>  and is relative to
> -.Ar todir
> +.Ar targetdir
>  (not the current directory).
>  .Pp
>  If you add files, simply run
> @@ -134,23 +134,23 @@
>  .El
>  .It Fl i
>  If a file in
> -.Ar fromdir
> +.Ar sourcedir
>  is a symbolic link,
>  .Nm
>  will make the same link in
> -.Ar todir
> +.Ar targetdir
>  rather than making a link back to the (symbolic link) entry in
> -.Ar fromdir .
> +.Ar sourcedir .
>  The
>  .Fl i
>  flag changes that behavior,
>  i.e. it causes the program to not treat symbolic links in
> -.Ar fromdir
> +.Ar sourcedir
>  specially.
>  The link created in
> -.Ar todir
> +.Ar targetdir
>  will point back to the corresponding (symbolic link) file in
> -.Ar fromdir .
> +.Ar sourcedir .
>  If the link is to a directory, this is almost certainly the wrong thing.
>  .Pp
>  This option exists mostly to emulate the behavior the C version of
> @@ -195,10 +195,10 @@
>  .Pp
>  To clear out all files before you can relink
>  (if
> -.Ar fromdir
> +.Ar sourcedir
>  moved, for instance):
>  .Bd -literal -offset indent
> -$ find todir -type l -print0 | xargs -0 -r rm
> +$ find targetdir -type l -print0 | xargs -0 -r rm
>  .Ed
>  .Pp
>  Find all files that are not directories:
> Index: usr.bin/lndir/lndir.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/lndir/lndir.c,v
> retrieving revision 1.17
> diff -u -r1.17 lndir.c
> --- usr.bin/lndir/lndir.c 4 Oct 2005 19:30:00 -0000 1.17
> +++ usr.bin/lndir/lndir.c 3 Sep 2006 02:21:33 -0000
> @@ -310,7 +310,7 @@
>  void
>  usage(void)
>  {
> - (void)fprintf(stderr, "usage: %s [-is] [-e exceptfile] fromdir [todir]\n",
> + (void)fprintf(stderr, "usage: %s [-is] [-e exceptfile] sourcedir [targetdir]\n",
>      __progname);
>   exit(1);
>  }

Reply | Threaded
Open this post in threaded view
|

Re: simple diff for lndir.{1,c} to use same terminology as ln(1)

jared r r spiegel
On Sun, Sep 03, 2006 at 05:47:59AM +0059, Jason McIntyre wrote:
> On Sat, Sep 02, 2006 at 10:24:30PM -0400, jared r r spiegel wrote:
> >   noticed that ln uses 'sourcefile' and 'targetfile', but lndir
> >   uses 'fromdir' and 'todir'.  in case it is desired that lndir
> >   use similar terms to ln (s/fromdir/sourcedir/g; s/todir/targetdir/g),
> >   here is diff for lndir.1 and lndir.c (the usage section):
> >
>
> unless there is a good reason to prefer one version over the other, i
> don;t see a need for this.

  what made me think of it was how lndir(1) has ln(1) in its "SEE ALSO",
  and that since the concepts are the same, the synopsis/syntax terms
  may as well be the same too.

  jared