Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84D48C433E2 for ; Tue, 15 Sep 2020 23:53:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4318420739 for ; Tue, 15 Sep 2020 23:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600214031; bh=rI0fa3jWEPGCQ/FYbvwzEmcsFt/IgkMuG6lhrLVEHpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TvBfdCOMeFe9d+5pEhMY0+W2ViHmRubzkhyQkIROlJfIsnJcpKy10/mdAZ/Zu+DTS P3hbXAaEj3/Tpn8SlHILAHVrMIGp9i1reX9K+EPHQGlW5Tk5EN1jRFC5ARhT3eRz9H JnLb8FhNXOUyiVONPuqmuc0aeZR//lVaFZ7ifmaE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbgIOXxr (ORCPT ); Tue, 15 Sep 2020 19:53:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:49630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727150AbgIOXxC (ORCPT ); Tue, 15 Sep 2020 19:53:02 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7E8CA21D7F; Tue, 15 Sep 2020 23:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600213981; bh=rI0fa3jWEPGCQ/FYbvwzEmcsFt/IgkMuG6lhrLVEHpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hdNmIEEKdaHEki7GJ/biXuFCgblo6+yyzVEnQMBQmaQAErga23jMH7UVpGoODuYmG K3vq3KE2RHPh81/1vc5eRvh2Xe6uSNyV91AAce8t1sRImU0HTLPtS8gIQ6ko4sPd9/ nd3C0wmqYy/riGCbputAlpxJFQbmVl1BmxjSIf3c= From: Jakub Kicinski To: mkubecek@suse.cz Cc: netdev@vger.kernel.org, Jakub Kicinski Subject: [PATCH ethtool-next 3/5] separate FLAGS out in -h Date: Tue, 15 Sep 2020 16:52:57 -0700 Message-Id: <20200915235259.457050-4-kuba@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200915235259.457050-1-kuba@kernel.org> References: <20200915235259.457050-1-kuba@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Help output is quite crowded already with every command being prefixed by --debug and --json options, and we're about to add a third one. Add an indirection. Signed-off-by: Jakub Kicinski --- ethtool.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ethtool.c b/ethtool.c index 23ecfcfd069c..ae5310e9e306 100644 --- a/ethtool.c +++ b/ethtool.c @@ -5947,10 +5947,10 @@ static int show_usage(struct cmd_context *ctx __maybe_unused) fprintf(stdout, PACKAGE " version " VERSION "\n"); fprintf(stdout, "Usage:\n" - " ethtool [ --debug MASK ][ --json ] DEVNAME\t" + " ethtool [ FLAGS ] DEVNAME\t" "Display standard information about device\n"); for (i = 0; args[i].opts; i++) { - fputs(" ethtool [ --debug MASK ][ --json ] ", stdout); + fputs(" ethtool [ FLAGS ] ", stdout); fprintf(stdout, "%s %s\t%s\n", args[i].opts, args[i].no_dev ? "\t" : "DEVNAME", @@ -5959,7 +5959,10 @@ static int show_usage(struct cmd_context *ctx __maybe_unused) fputs(args[i].xhelp, stdout); } nl_monitor_usage(); - fprintf(stdout, "Not all options support JSON output\n"); + fprintf(stdout, "\n"); + fprintf(stdout, "FLAGS:\n"); + fprintf(stdout, " --debug MASK turn on debugging messages\n"); + fprintf(stdout, " --json enable JSON output format (not supported by all commands)\n"); return 0; } -- 2.26.2