wireguard: fix 'wireguard add peer' cli behavior 33/34633/3
authorMiroslav Miklus <miroslav.miklus@pantheon.tech>
Wed, 1 Dec 2021 20:35:59 +0000 (21:35 +0100)
committerFan Zhang <roy.fan.zhang@intel.com>
Wed, 5 Jan 2022 09:51:29 +0000 (09:51 +0000)
- change 'port' to 'dst-port' to make the input self-explanatory
- add empty spaces to short help

Type: fix

Signed-off-by: Miroslav Miklus <miroslav.miklus@pantheon.tech>
Change-Id: I74c783e6e8629e61b1c100e9355d09cf5e35a750

src/plugins/wireguard/wireguard_cli.c

index 05275f7..f821a3c 100644 (file)
@@ -192,7 +192,7 @@ wg_peer_add_command_fn (vlib_main_t * vm,
        ;
       else if (unformat (line_input, "table-id %d", &table_id))
        ;
-      else if (unformat (line_input, "port %d", &portDst))
+      else if (unformat (line_input, "dst-port %d", &portDst))
        ;
       else if (unformat (line_input, "persistent-keepalive %d",
                         &persistent_keepalive))
@@ -246,12 +246,12 @@ done:
 }
 
 /* *INDENT-OFF* */
-VLIB_CLI_COMMAND (wg_peer_add_command, static) =
-{
+VLIB_CLI_COMMAND (wg_peer_add_command, static) = {
   .path = "wireguard peer add",
-  .short_help = "wireguard peer add <wg_int> public-key <pub_key_other>"
-  "endpoint <ip4_dst> allowed-ip <prefix>"
-  "dst-port [port_dst] persistent-keepalive [keepalive_interval]",
+  .short_help =
+    "wireguard peer add <wg_int> public-key <pub_key_other> "
+    "endpoint <ip4_dst> allowed-ip <prefix> "
+    "dst-port [port_dst] persistent-keepalive [keepalive_interval]",
   .function = wg_peer_add_command_fn,
 };
 /* *INDENT-ON* */