diff options
author | Michal Kubecek <mkubecek@suse.cz> | 2021-12-17 18:51:36 +0100 |
---|---|---|
committer | Michal Kubecek <mkubecek@suse.cz> | 2021-12-17 18:51:36 +0100 |
commit | 32457a912a5793bc75d0e55a83bf7eceb9e2cf8b (patch) | |
tree | c5f878b6379b0cd9f99ba36c49db3c396fbffc3f | |
parent | 429f2fc288437a2c54ce7cb47b7f1c47dc3e1c9a (diff) | |
download | ethtool-32457a912a5793bc75d0e55a83bf7eceb9e2cf8b.tar.gz |
monitor: do not show duplicate options in help text
Options "-s" and "--change" are listed multiple times in monitor_opts[]
because they need to catch multiple message types. Show them only once in
generated --monitor section of "ethtool --help" output.
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
-rw-r--r-- | netlink/monitor.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/netlink/monitor.c b/netlink/monitor.c index 0c4df9e..6cbd772 100644 --- a/netlink/monitor.c +++ b/netlink/monitor.c @@ -302,6 +302,8 @@ void nl_monitor_usage(void) stdout); fputs(" ( [ --all ]", stdout); for (i = 1; i < MNL_ARRAY_SIZE(monitor_opts); i++) { + if (!strcmp(monitor_opts[i].pattern, monitor_opts[i - 1].pattern)) + continue; fputs("\n | ", stdout); for (p = monitor_opts[i].pattern; *p; p++) if (*p == '|') |