All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2 1/2] ip: Make uniform the use of synonyms list, show and lst
@ 2015-03-16  9:59 Mark Einon
  2015-03-16  9:59 ` [PATCH iproute2 2/2] ip: Harmonise usage references to show / list option Mark Einon
  2015-03-24 21:49 ` [PATCH iproute2 1/2] ip: Make uniform the use of synonyms list, show and lst Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Einon @ 2015-03-16  9:59 UTC (permalink / raw)
  To: stephen; +Cc: netdev, Mark Einon

Where used in the ip tool, the 'show' option always has the synonyms
'list' and 'lst', except for ip-token and ip-addrlabel, which are missing
'lst'. Add this as a synonym for these commands.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
 ip/ipaddrlabel.c | 1 +
 ip/iptoken.c     | 1 +
 2 files changed, 2 insertions(+)

diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
index b34dd8b..f6a638b 100644
--- a/ip/ipaddrlabel.c
+++ b/ip/ipaddrlabel.c
@@ -248,6 +248,7 @@ int do_ipaddrlabel(int argc, char **argv)
 	if (argc < 1) {
 		return ipaddrlabel_list(0, NULL);
 	} else if (matches(argv[0], "list") == 0 ||
+		   matches(argv[0], "lst") == 0 ||
 		   matches(argv[0], "show") == 0) {
 		return ipaddrlabel_list(argc-1, argv+1);
 	} else if (matches(argv[0], "add") == 0) {
diff --git a/ip/iptoken.c b/ip/iptoken.c
index 5689c2e..655f160 100644
--- a/ip/iptoken.c
+++ b/ip/iptoken.c
@@ -195,6 +195,7 @@ int do_iptoken(int argc, char **argv)
 	if (argc < 1) {
 		return iptoken_list(0, NULL);
 	} else if (matches(argv[0], "list") == 0 ||
+		   matches(argv[0], "lst") == 0 ||
 		   matches(argv[0], "show") == 0) {
 		return iptoken_list(argc - 1, argv + 1);
 	} else if (matches(argv[0], "set") == 0 ||
-- 
2.1.4

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

* [PATCH iproute2 2/2] ip: Harmonise usage references to show / list option
  2015-03-16  9:59 [PATCH iproute2 1/2] ip: Make uniform the use of synonyms list, show and lst Mark Einon
@ 2015-03-16  9:59 ` Mark Einon
  2015-03-24 21:53   ` Stephen Hemminger
  2015-03-24 21:49 ` [PATCH iproute2 1/2] ip: Make uniform the use of synonyms list, show and lst Stephen Hemminger
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Einon @ 2015-03-16  9:59 UTC (permalink / raw)
  To: stephen; +Cc: netdev, Mark Einon

The majority of ip commands that implement show / list options reference
only the 'show' option in usage notes. Some others reference only
'list', while ip-tuntap references both. Additionally, ip-addrlabel and
ip-rule reference 'list' in usage notes while having an error message
that references 'show', which is confusing.

Harmonise all these references to be the current majority choice of
'show'.

Prefer alphabetical listing of options where changes are made.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
 ip/ipaddrlabel.c | 2 +-
 ip/ipnetns.c     | 2 +-
 ip/iproute.c     | 2 +-
 ip/iprule.c      | 2 +-
 ip/iptoken.c     | 2 +-
 ip/iptuntap.c    | 2 +-
 ip/xfrm_policy.c | 2 +-
 ip/xfrm_state.c  | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
index f6a638b..ab4a1e4 100644
--- a/ip/ipaddrlabel.c
+++ b/ip/ipaddrlabel.c
@@ -49,7 +49,7 @@ static void usage(void) __attribute__((noreturn));
 
 static void usage(void)
 {
-	fprintf(stderr, "Usage: ip addrlabel [ list | add | del | flush ] prefix PREFIX [ dev DEV ] [ label LABEL ]\n");
+	fprintf(stderr, "Usage: ip addrlabel [ add | del | flush | show ] prefix PREFIX [ dev DEV ] [ label LABEL ]\n");
 	exit(-1);
 }
 
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 45e234a..4b47fb4 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -23,7 +23,7 @@
 
 static int usage(void)
 {
-	fprintf(stderr, "Usage: ip netns list\n");
+	fprintf(stderr, "Usage: ip netns show\n");
 	fprintf(stderr, "       ip netns add NAME\n");
 	fprintf(stderr, "       ip netns set NAME NETNSID\n");
 	fprintf(stderr, "       ip [-all] netns delete [NAME]\n");
diff --git a/ip/iproute.c b/ip/iproute.c
index c842e85..b863e7b 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -59,7 +59,7 @@ static void usage(void) __attribute__((noreturn));
 
 static void usage(void)
 {
-	fprintf(stderr, "Usage: ip route { list | flush } SELECTOR\n");
+	fprintf(stderr, "Usage: ip route { flush | show } SELECTOR\n");
 	fprintf(stderr, "       ip route save SELECTOR\n");
 	fprintf(stderr, "       ip route restore\n");
 	fprintf(stderr, "       ip route showdump\n");
diff --git a/ip/iprule.c b/ip/iprule.c
index 54ed753..95a28e6 100644
--- a/ip/iprule.c
+++ b/ip/iprule.c
@@ -32,7 +32,7 @@ static void usage(void) __attribute__((noreturn));
 
 static void usage(void)
 {
-	fprintf(stderr, "Usage: ip rule [ list | add | del | flush ] SELECTOR ACTION\n");
+	fprintf(stderr, "Usage: ip rule [ add | del | flush | show ] SELECTOR ACTION\n");
 	fprintf(stderr, "SELECTOR := [ not ] [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK[/MASK] ]\n");
 	fprintf(stderr, "            [ iif STRING ] [ oif STRING ] [ pref NUMBER ]\n");
 	fprintf(stderr, "ACTION := [ table TABLE_ID ]\n");
diff --git a/ip/iptoken.c b/ip/iptoken.c
index 655f160..e53dbca 100644
--- a/ip/iptoken.c
+++ b/ip/iptoken.c
@@ -38,7 +38,7 @@ static void usage(void) __attribute__((noreturn));
 
 static void usage(void)
 {
-	fprintf(stderr, "Usage: ip token [ list | set | get ] [ TOKEN ] [ dev DEV ]\n");
+	fprintf(stderr, "Usage: ip token [ get | set | show ] [ TOKEN ] [ dev DEV ]\n");
 	exit(-1);
 }
 
diff --git a/ip/iptuntap.c b/ip/iptuntap.c
index b9b28a1..de54f52 100644
--- a/ip/iptuntap.c
+++ b/ip/iptuntap.c
@@ -36,7 +36,7 @@ static void usage(void) __attribute__((noreturn));
 
 static void usage(void)
 {
-	fprintf(stderr, "Usage: ip tuntap { add | del | show | list | lst | help } [ dev PHYS_DEV ] \n");
+	fprintf(stderr, "Usage: ip tuntap { add | del | show | help } [ dev PHYS_DEV ] \n");
 	fprintf(stderr, "          [ mode { tun | tap } ] [ user USER ] [ group GROUP ]\n");
 	fprintf(stderr, "          [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ]\n");
 	fprintf(stderr, "\n");
diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c
index 2337d35..da732b8 100644
--- a/ip/xfrm_policy.c
+++ b/ip/xfrm_policy.c
@@ -59,7 +59,7 @@ static void usage(void)
 	fprintf(stderr, "        [ LIMIT-LIST ] [ TMPL-LIST ]\n");
 	fprintf(stderr, "Usage: ip xfrm policy { delete | get } { SELECTOR | index INDEX } dir DIR\n");
 	fprintf(stderr, "        [ ctx CTX ] [ mark MARK [ mask MASK ] ] [ ptype PTYPE ]\n");
-	fprintf(stderr, "Usage: ip xfrm policy { deleteall | list } [ SELECTOR ] [ dir DIR ]\n");
+	fprintf(stderr, "Usage: ip xfrm policy { deleteall | show } [ SELECTOR ] [ dir DIR ]\n");
 	fprintf(stderr, "        [ index INDEX ] [ ptype PTYPE ] [ action ACTION ] [ priority PRIORITY ]\n");
 	fprintf(stderr, "        [ flag FLAG-LIST ]\n");
 	fprintf(stderr, "Usage: ip xfrm policy flush [ ptype PTYPE ]\n");
diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
index 2ad3d8d..e7463fb 100644
--- a/ip/xfrm_state.c
+++ b/ip/xfrm_state.c
@@ -64,7 +64,7 @@ static void usage(void)
 	fprintf(stderr, "Usage: ip xfrm state allocspi ID [ mode MODE ] [ mark MARK [ mask MASK ] ]\n");
 	fprintf(stderr, "        [ reqid REQID ] [ seq SEQ ] [ min SPI max SPI ]\n");
 	fprintf(stderr, "Usage: ip xfrm state { delete | get } ID [ mark MARK [ mask MASK ] ]\n");
-	fprintf(stderr, "Usage: ip xfrm state { deleteall | list } [ ID ] [ mode MODE ] [ reqid REQID ]\n");
+	fprintf(stderr, "Usage: ip xfrm state { deleteall | show } [ ID ] [ mode MODE ] [ reqid REQID ]\n");
 	fprintf(stderr, "        [ flag FLAG-LIST ]\n");
 	fprintf(stderr, "Usage: ip xfrm state flush [ proto XFRM-PROTO ]\n");
 	fprintf(stderr, "Usage: ip xfrm state count\n");
-- 
2.1.4

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

* Re: [PATCH iproute2 1/2] ip: Make uniform the use of synonyms list, show and lst
  2015-03-16  9:59 [PATCH iproute2 1/2] ip: Make uniform the use of synonyms list, show and lst Mark Einon
  2015-03-16  9:59 ` [PATCH iproute2 2/2] ip: Harmonise usage references to show / list option Mark Einon
@ 2015-03-24 21:49 ` Stephen Hemminger
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2015-03-24 21:49 UTC (permalink / raw)
  To: Mark Einon; +Cc: netdev

On Mon, 16 Mar 2015 09:59:09 +0000
Mark Einon <mark.einon@gmail.com> wrote:

> Where used in the ip tool, the 'show' option always has the synonyms
> 'list' and 'lst', except for ip-token and ip-addrlabel, which are missing
> 'lst'. Add this as a synonym for these commands.
> 
> Signed-off-by: Mark Einon <mark.einon@gmail.com>

Applied

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

* Re: [PATCH iproute2 2/2] ip: Harmonise usage references to show / list option
  2015-03-16  9:59 ` [PATCH iproute2 2/2] ip: Harmonise usage references to show / list option Mark Einon
@ 2015-03-24 21:53   ` Stephen Hemminger
  2015-03-25  9:26     ` Mark Einon
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2015-03-24 21:53 UTC (permalink / raw)
  To: Mark Einon; +Cc: netdev

On Mon, 16 Mar 2015 09:59:10 +0000
Mark Einon <mark.einon@gmail.com> wrote:

> diff --git a/ip/iproute.c b/ip/iproute.c
> index c842e85..b863e7b 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -59,7 +59,7 @@ static void usage(void) __attribute__((noreturn));
>  
>  static void usage(void)
>  {
> -	fprintf(stderr, "Usage: ip route { list | flush } SELECTOR\n");

Sorry, this sounds like a good idea until I went and checked what
is shown on the man pages.

The ip route man page has:

       ip route { list | flush } SELECTOR

For me, it is more important that the usage match the man page,
rather than having all usage messages match.

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

* Re: [PATCH iproute2 2/2] ip: Harmonise usage references to show / list option
  2015-03-24 21:53   ` Stephen Hemminger
@ 2015-03-25  9:26     ` Mark Einon
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Einon @ 2015-03-25  9:26 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

On Tue, Mar 24, 2015 at 02:53:15PM -0700, Stephen Hemminger wrote:
> On Mon, 16 Mar 2015 09:59:10 +0000
> Mark Einon <mark.einon@gmail.com> wrote:
> 
> > diff --git a/ip/iproute.c b/ip/iproute.c
> > index c842e85..b863e7b 100644
> > --- a/ip/iproute.c
> > +++ b/ip/iproute.c
> > @@ -59,7 +59,7 @@ static void usage(void) __attribute__((noreturn));
> >  
> >  static void usage(void)
> >  {
> > -	fprintf(stderr, "Usage: ip route { list | flush } SELECTOR\n");
> 
> Sorry, this sounds like a good idea until I went and checked what
> is shown on the man pages.
> 
> The ip route man page has:
> 
>        ip route { list | flush } SELECTOR
> 
> For me, it is more important that the usage match the man page,
> rather than having all usage messages match.

Thanks for the review Stephen. So, I'm assuming that a set of patches
with corresponding man page fixes would be acceptable? I was going to
look at those next anyway, time permitting.

Mark

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

end of thread, other threads:[~2015-03-25  9:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16  9:59 [PATCH iproute2 1/2] ip: Make uniform the use of synonyms list, show and lst Mark Einon
2015-03-16  9:59 ` [PATCH iproute2 2/2] ip: Harmonise usage references to show / list option Mark Einon
2015-03-24 21:53   ` Stephen Hemminger
2015-03-25  9:26     ` Mark Einon
2015-03-24 21:49 ` [PATCH iproute2 1/2] ip: Make uniform the use of synonyms list, show and lst 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.