bug#47703: Same category as "ln " (was: bug#47703: Mention if ln -s needs -r, or ln -r needs -s)

2021-04-29 Thread L A Walsh

On 2021/04/11 07:21, Pádraig Brady wrote:

On 09/04/2021 12:46, 積丹尼 Dan Jacobson wrote:

man ln says:
-r, --relative
   create symbolic links relative to link location
-s, --symbolic
   make symbolic links instead of hard links
Hard to tell from the man page.

---
   Seems like another related example ignoring what the user wants and
issuing an error for an inexact usage.

   If you used "-r" by itself, or if you try linking a directory,
either without "-s", you get an error message, when it would be more
helpful to assume "-s" and give a diagnostic if "interactive" (assumption
being, that if it was in a script, it was obviously intended that way,
as any other way generates an error).


Fair point.
thanks, Pádraig







bug#47703: Mention if ln -s needs -r, or ln -r needs -s

2021-04-11 Thread Pádraig Brady

On 09/04/2021 12:46, 積丹尼 Dan Jacobson wrote:

man ln says:

-r, --relative
   create symbolic links relative to link location

-s, --symbolic
   make symbolic links instead of hard links

Does -s need -r,
or   -r need -s?

Hard to tell from the man page.

Had to find out the 'hard' way.

Please mention the answer on the man page.


Fair point.
Will address with the attached.
Marking this as done.

thanks,
Pádraig
>From 572b74dd5f6d672eecd8b43e5eab443744fbc090 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= 
Date: Sun, 11 Apr 2021 15:17:02 +0100
Subject: [PATCH] doc: clarify that ln --relative requires --symbolic to be
 specified

* doc/coreutils.texi (ln invocation): State --symbolic is required.
* src/ln.c (usage): Explicitly state -s is not implied.
Fixes https://bugs.gnu.org/47703
---
 doc/coreutils.texi | 1 +
 src/ln.c   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index e53c0de6e..acc1841fa 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -10584,6 +10584,7 @@ link will be the same as if a hard link had been created.
 @opindex -r
 @opindex --relative
 Make symbolic links relative to the link location.
+This option is only valid with the @option{--symbolic} option.
 
 Example:
 
diff --git a/src/ln.c b/src/ln.c
index d0319ef4e..9974d9647 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -447,7 +447,7 @@ interpreted in relation to its parent directory.\n\
   -n, --no-dereferencetreat LINK_NAME as a normal file if\n\
 it is a symbolic link to a directory\n\
   -P, --physical  make hard links directly to symbolic links\n\
-  -r, --relative  create symbolic links relative to link location\n\
+  -r, --relative  with -s, create links relative to link location\n\
   -s, --symbolic  make symbolic links instead of hard links\n\
 "), stdout);
   fputs (_("\
-- 
2.26.2



bug#47703: Mention if ln -s needs -r, or ln -r needs -s

2021-04-10 Thread 積丹尼 Dan Jacobson
man ln says:

   -r, --relative
  create symbolic links relative to link location

   -s, --symbolic
  make symbolic links instead of hard links

Does -s need -r,
or   -r need -s?

Hard to tell from the man page.

Had to find out the 'hard' way.

Please mention the answer on the man page.

Thanks.