From mboxrd@z Thu Jan 1 00:00:00 1970 From: Prashant Bhole Subject: [PATCH bpf-next v2] samples/bpf: xdp_monitor, accept short options Date: Mon, 14 May 2018 17:29:15 +0900 Message-ID: <20180514082915.3364-1-bhole_prashant_q7@lab.ntt.co.jp> Cc: Prashant Bhole , Jesper Dangaard Brouer , "David S . Miller" , netdev@vger.kernel.org To: Daniel Borkmann , Alexei Starovoitov Return-path: Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:53885 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752041AbeENIaq (ORCPT ); Mon, 14 May 2018 04:30:46 -0400 Sender: netdev-owner@vger.kernel.org List-ID: Updated optstring parameter for getopt_long() to accept short options. Also updated usage() function. Signed-off-by: Prashant Bhole --- samples/bpf/xdp_monitor_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/bpf/xdp_monitor_user.c b/samples/bpf/xdp_monitor_user.c index 894bc64c2cac..05ad3f590c91 100644 --- a/samples/bpf/xdp_monitor_user.c +++ b/samples/bpf/xdp_monitor_user.c @@ -58,7 +58,7 @@ static void usage(char *argv[]) printf(" flag (internal value:%d)", *long_options[i].flag); else - printf("(internal short-option: -%c)", + printf("short-option: -%c", long_options[i].val); printf("\n"); } @@ -594,7 +594,7 @@ int main(int argc, char **argv) snprintf(bpf_obj_file, sizeof(bpf_obj_file), "%s_kern.o", argv[0]); /* Parse commands line args */ - while ((opt = getopt_long(argc, argv, "h", + while ((opt = getopt_long(argc, argv, "hDSs:", long_options, &longindex)) != -1) { switch (opt) { case 'D': -- 2.13.6