From patchwork Tue Oct 6 15:04:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 1377500 X-Patchwork-Delegate: mkubecek@suse.cz Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=Xuxg3fdF; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4C5LNR3HNQz9sS8 for ; Wed, 7 Oct 2020 02:04:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726460AbgJFPEi (ORCPT ); Tue, 6 Oct 2020 11:04:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:45392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbgJFPEd (ORCPT ); Tue, 6 Oct 2020 11:04:33 -0400 Received: from kicinski-fedora-PC1C0HJN.thefacebook.com (unknown [163.114.132.1]) (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 51D5D2078E; Tue, 6 Oct 2020 15:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601996672; bh=7jZD/GtUD3QHyHulr4ysB0ecL1g3/Rs1Jq5fu1SCE4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xuxg3fdF/c0uUMoNV1iZ4qLJtLCQGLGa5+6TyyZD6OwsHdIKUTqlogz+audPgWHl8 zNOrewObKlQZYEk4FqO/uLCOBTZcSn6lVM4Sce7rmrRwosDm6TgKMpG7WVRGgrlaJR H34XaPAFQVnOixMPaXpiu2Xz0ieV2QklYBU+31V8= From: Jakub Kicinski To: mkubecek@suse.cz Cc: netdev@vger.kernel.org, kernel-team@fb.com, Jakub Kicinski Subject: [PATCH ethtool-next v2 3/6] separate FLAGS out in -h Date: Tue, 6 Oct 2020 08:04:22 -0700 Message-Id: <20201006150425.2631432-4-kuba@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201006150425.2631432-1-kuba@kernel.org> References: <20201006150425.2631432-1-kuba@kernel.org> MIME-Version: 1.0 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 2a7de97c51bb..403616bb7fa0 100644 --- a/ethtool.c +++ b/ethtool.c @@ -6015,10 +6015,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", @@ -6027,7 +6027,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; }