From patchwork Thu Jan 24 02:51:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prashant Bhole X-Patchwork-Id: 1030256 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lab.ntt.co.jp Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43lRYD43Nmz9s4s for ; Thu, 24 Jan 2019 13:53:20 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727136AbfAXCxS (ORCPT ); Wed, 23 Jan 2019 21:53:18 -0500 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]:35694 "EHLO tama500.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726783AbfAXCxR (ORCPT ); Wed, 23 Jan 2019 21:53:17 -0500 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x0O2qp13011854; Thu, 24 Jan 2019 11:52:51 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id CA22C63849B; Thu, 24 Jan 2019 11:52:51 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id BECA2638435; Thu, 24 Jan 2019 11:52:51 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (unknown [129.60.241.220]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id B6408400B0B; Thu, 24 Jan 2019 11:52:51 +0900 (JST) From: Prashant Bhole Subject: [PATCH bpf-next] bpftool: feature probing, change default action Date: Thu, 24 Jan 2019 11:51:57 +0900 Message-Id: <20190124025157.6812-1-bhole_prashant_q7@lab.ntt.co.jp> X-Mailer: git-send-email 2.14.2 X-CC-Mail-RelayStamp: 1 To: Alexei Starovoitov , Daniel Borkmann Cc: Prashant Bhole , netdev@vger.kernel.org, Quentin Monnet , Jakub Kicinski X-TM-AS-MML: disable Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When 'bpftool feature' is executed it shows incorrect help string. test# bpftool feature Usage: bpftool bpftool probe [COMPONENT] [macros [prefix PREFIX]] bpftool bpftool help COMPONENT := { kernel | dev NAME } Instead of fixing the help text by tweaking argv[] indices, this patch changes the default action to 'probe'. It makes the behavior consistent with other subcommands, where first subcommand without extra parameter results in 'show' action. Signed-off-by: Prashant Bhole Reviewed-by: Quentin Monnet --- tools/bpf/bpftool/feature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c index 993c6f1e5473..d672d9086fff 100644 --- a/tools/bpf/bpftool/feature.c +++ b/tools/bpf/bpftool/feature.c @@ -753,8 +753,8 @@ static int do_help(int argc, char **argv) } static const struct cmd cmds[] = { - { "help", do_help }, { "probe", do_probe }, + { "help", do_help }, { 0 } };