All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ip: Make errors direct to "list" instead of "show"
@ 2024-03-25 20:48 Yedaya Katsman
  2024-03-25 21:19 ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Yedaya Katsman @ 2024-03-25 20:48 UTC (permalink / raw
  To: netdev; +Cc: Stephen Hemminger, Yedaya Katsman

The usage text and man pages only have "list" in them, but the errors
when using "ip ila list" and "ip addrlabel list" incorrectly direct to
running the "show" subcommand. Make them consistent by mentioning "list"
instead.

Signed-off-by: Yedaya Katsman <yedaya.ka@gmail.com>
---
 ip/ipaddrlabel.c | 2 +-
 ip/ipila.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
index b045827a03ea..d343993b64a9 100644
--- a/ip/ipaddrlabel.c
+++ b/ip/ipaddrlabel.c
@@ -101,7 +101,7 @@ static int ipaddrlabel_list(int argc, char **argv)
 		af = AF_INET6;
 
 	if (argc > 0) {
-		fprintf(stderr, "\"ip addrlabel show\" does not take any arguments.\n");
+		fprintf(stderr, "\"ip addrlabel list\" does not take any arguments.\n");
 		return -1;
 	}
 
diff --git a/ip/ipila.c b/ip/ipila.c
index f4387e039f97..50d834f4625c 100644
--- a/ip/ipila.c
+++ b/ip/ipila.c
@@ -142,7 +142,7 @@ static int do_list(int argc, char **argv)
 	ILA_REQUEST(req, 1024, ILA_CMD_GET, NLM_F_REQUEST | NLM_F_DUMP);
 
 	if (argc > 0) {
-		fprintf(stderr, "\"ip ila show\" does not take "
+		fprintf(stderr, "\"ip ila list\" does not take "
 			"any arguments.\n");
 		return -1;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ip: Make errors direct to "list" instead of "show"
  2024-03-25 20:48 [PATCH] ip: Make errors direct to "list" instead of "show" Yedaya Katsman
@ 2024-03-25 21:19 ` Stephen Hemminger
  2024-03-25 21:45   ` Yedaya
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2024-03-25 21:19 UTC (permalink / raw
  To: Yedaya Katsman; +Cc: netdev

On Mon, 25 Mar 2024 22:48:37 +0200
Yedaya Katsman <yedaya.ka@gmail.com> wrote:

> The usage text and man pages only have "list" in them, but the errors
> when using "ip ila list" and "ip addrlabel list" incorrectly direct to
> running the "show" subcommand. Make them consistent by mentioning "list"
> instead.
> 
> Signed-off-by: Yedaya Katsman <yedaya.ka@gmail.com>

That is because ip command treats "list" and "show" the same.
Would it be better to do the same in all sub commands?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ip: Make errors direct to "list" instead of "show"
  2024-03-25 21:19 ` Stephen Hemminger
@ 2024-03-25 21:45   ` Yedaya
  2024-03-28  2:17     ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Yedaya @ 2024-03-25 21:45 UTC (permalink / raw
  To: netdev; +Cc: Stephen Hemminger, Yedaya Katsman

On Mon, Mar 25, 2024 at 02:19:20PM -0700, Stephen Hemminger wrote:
> On Mon, 25 Mar 2024 22:48:37 +0200
> Yedaya Katsman <yedaya.ka@gmail.com> wrote:
> 
> > The usage text and man pages only have "list" in them, but the errors
> > when using "ip ila list" and "ip addrlabel list" incorrectly direct to
> > running the "show" subcommand. Make them consistent by mentioning "list"
> > instead.
> > 
> > Signed-off-by: Yedaya Katsman <yedaya.ka@gmail.com>
> 
> That is because ip command treats "list" and "show" the same.
> Would it be better to do the same in all sub commands?
>
I'm not sure what else you're talking about changing, I couldn't find
anywhere where a "show" is referenced in output. Do you mean treating
"show" and "list" the same everywhere?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ip: Make errors direct to "list" instead of "show"
  2024-03-25 21:45   ` Yedaya
@ 2024-03-28  2:17     ` Stephen Hemminger
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2024-03-28  2:17 UTC (permalink / raw
  To: Yedaya; +Cc: netdev

On Mon, 25 Mar 2024 23:45:05 +0200
Yedaya <yedaya.ka@gmail.com> wrote:

> On Mon, Mar 25, 2024 at 02:19:20PM -0700, Stephen Hemminger wrote:
> > On Mon, 25 Mar 2024 22:48:37 +0200
> > Yedaya Katsman <yedaya.ka@gmail.com> wrote:
> >   
> > > The usage text and man pages only have "list" in them, but the errors
> > > when using "ip ila list" and "ip addrlabel list" incorrectly direct to
> > > running the "show" subcommand. Make them consistent by mentioning "list"
> > > instead.
> > > 
> > > Signed-off-by: Yedaya Katsman <yedaya.ka@gmail.com>  
> > 
> > That is because ip command treats "list" and "show" the same.
> > Would it be better to do the same in all sub commands?
> >  
> I'm not sure what else you're talking about changing, I couldn't find
> anywhere where a "show" is referenced in output. Do you mean treating
> "show" and "list" the same everywhere?

Almost all of iproute utils allow list, show, or lst.

You found a couple of places that may not.
Perhaps this will fix it.

From f65a5b0d0757ab7d9c57d0962ca903dd095ce20b Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 27 Mar 2024 16:55:09 -0700
Subject: [PATCH] ipila: allow show, list and lst as synonyms

Across ip commands show, list and misspelling lst are treated
the same.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 ip/ipila.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ip/ipila.c b/ip/ipila.c
index f4387e03..80f34f29 100644
--- a/ip/ipila.c
+++ b/ip/ipila.c
@@ -301,7 +301,9 @@ int do_ipila(int argc, char **argv)
 		return do_add(argc-1, argv+1);
 	if (matches(*argv, "delete") == 0)
 		return do_del(argc-1, argv+1);
-	if (matches(*argv, "list") == 0)
+	if (matches(*argv, "show") == 0 ||
+	    matches(*argv, "lst") == 0 ||
+	    matches(*argv, "list") == 0)
 		return do_list(argc-1, argv+1);
 
 	fprintf(stderr, "Command \"%s\" is unknown, try \"ip ila help\".\n",
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-28  2:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25 20:48 [PATCH] ip: Make errors direct to "list" instead of "show" Yedaya Katsman
2024-03-25 21:19 ` Stephen Hemminger
2024-03-25 21:45   ` Yedaya
2024-03-28  2:17     ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.