Commit 53ea24c2 authored by Prashant Bhole's avatar Prashant Bhole Committed by Daniel Borkmann

samples/bpf: xdp_monitor, accept short options

Updated optstring parameter for getopt_long() to accept short options.
Also updated usage() function.
Signed-off-by: default avatarPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Acked-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 1772be37
...@@ -58,7 +58,7 @@ static void usage(char *argv[]) ...@@ -58,7 +58,7 @@ static void usage(char *argv[])
printf(" flag (internal value:%d)", printf(" flag (internal value:%d)",
*long_options[i].flag); *long_options[i].flag);
else else
printf("(internal short-option: -%c)", printf("short-option: -%c",
long_options[i].val); long_options[i].val);
printf("\n"); printf("\n");
} }
...@@ -594,7 +594,7 @@ int main(int argc, char **argv) ...@@ -594,7 +594,7 @@ int main(int argc, char **argv)
snprintf(bpf_obj_file, sizeof(bpf_obj_file), "%s_kern.o", argv[0]); snprintf(bpf_obj_file, sizeof(bpf_obj_file), "%s_kern.o", argv[0]);
/* Parse commands line args */ /* Parse commands line args */
while ((opt = getopt_long(argc, argv, "h", while ((opt = getopt_long(argc, argv, "hDSs:",
long_options, &longindex)) != -1) { long_options, &longindex)) != -1) {
switch (opt) { switch (opt) {
case 'D': case 'D':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment