From: Bence Romsics Date: Thu, 18 Jul 2024 08:57:12 +0000 (+0200) Subject: vat2: fix -p in vat2 help text X-Git-Tag: v25.10-rc0~125 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F77%2F41277%2F3;p=vpp.git vat2: fix -p in vat2 help text Since commit fe1fb3c31a short option -p stands for --plugin-path and -s stands for --prefix. Adjust the help text. Also fix a typo and sort option lists. Type: fix Change-Id: I8e9fd825cca930e13e0a09a4492f22951a25e2ee Signed-off-by: Bence Romsics --- diff --git a/src/vat2/main.c b/src/vat2/main.c index bf415854db1..2949c4899aa 100644 --- a/src/vat2/main.c +++ b/src/vat2/main.c @@ -253,16 +253,15 @@ print_help (void) "Send API message to VPP and print reply\n" "\n" "-d, --debug Print additional information\n" - "-p, --prefix Specify shared memory prefix to connect " - "to a given VPP instance\n" + "--dump-apis List all APIs available in VAT2 (might " + "not reflect running VPP)\n" "-f, --file File containing a JSON object with the " "arguments for the message to send\n" + "-p, --plugin-path Plugin path\n" + "-s, --prefix Specify shared memory prefix to connect " + "to a given VPP instance\n" "-t, --template Print a template JSON object for given API" - " message\n" - "--dump-apis List all APIs available in VAT2 (might " - "not reflect running VPP)\n" - "--plugin-path Pluing path" - "\n"; + " message\n"; printf ("%s", help_string); } @@ -281,38 +280,38 @@ main (int argc, char **argv) char *msgname = 0; static struct option long_options[] = { { "debug", no_argument, 0, 'd' }, - { "prefix", required_argument, 0, 's' }, - { "file", required_argument, 0, 'f' }, { "dump-apis", no_argument, 0, 0 }, - { "template", required_argument, 0, 't' }, + { "file", required_argument, 0, 'f' }, { "plugin-path", required_argument, 0, 'p' }, + { "prefix", required_argument, 0, 's' }, + { "template", required_argument, 0, 't' }, { 0, 0, 0, 0 } }; - while ((c = getopt_long (argc, argv, "hdp:f:t:", long_options, + while ((c = getopt_long (argc, argv, "df:p:s:t:", long_options, &option_index)) != -1) { switch (c) { case 0: - if (option_index == 3) + if (option_index == 1) dump_api = true; break; case 'd': vat2_debug = true; break; - case 't': - template = optarg; - break; - case 's': - prefix = optarg; - break; case 'f': filename = optarg; break; case 'p': pluginpath = optarg; break; + case 's': + prefix = optarg; + break; + case 't': + template = optarg; + break; case '?': print_help (); return 1;