From patchwork Fri Jul 27 18:30:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 10547571 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEDF713BB for ; Fri, 27 Jul 2018 18:30:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C56C32C363 for ; Fri, 27 Jul 2018 18:30:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9B162C36A; Fri, 27 Jul 2018 18:30:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F416A2C363 for ; Fri, 27 Jul 2018 18:30:55 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A7CB6210C2D9A; Fri, 27 Jul 2018 11:30:55 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=vishal.l.verma@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8D8C1210C2D6E for ; Fri, 27 Jul 2018 11:30:54 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2018 11:30:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,410,1526367600"; d="scan'208";a="248981273" Received: from vverma7-desk1.lm.intel.com ([10.232.112.133]) by fmsmga005.fm.intel.com with ESMTP; 27 Jul 2018 11:30:53 -0700 From: Vishal Verma To: Subject: [ndctl PATCH] ndctl: deprecate undocumented short-options Date: Fri, 27 Jul 2018 12:30:50 -0600 Message-Id: <20180727183050.13047-1-vishal.l.verma@intel.com> X-Mailer: git-send-email 2.14.4 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP The inject-smart and monitor man pages refrained from displaying short options for various arguments (alarms, daemon) due to a lack of a coherent letter that could be made to relate to the event name. It was expected that the user will always use the long option for these. Since the OPT_STRING helper refused to take an empty string for the short option, we used bogus characters for each of them. However there is a better way to provide no short options, and that is by using '\0' for the short option field to OPT_STRING. Replace the bogus characters with '\0' so that the 'short help' also becomes consistent with the man pages. Cc: Cc: QI Fuli Signed-off-by: Vishal Verma --- ndctl/inject-smart.c | 7 ++++--- ndctl/monitor.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ndctl/inject-smart.c b/ndctl/inject-smart.c index 006ea2a..edb87e1 100644 --- a/ndctl/inject-smart.c +++ b/ndctl/inject-smart.c @@ -73,7 +73,7 @@ OPT_STRING('M', "media-temperature-threshold", \ ¶m.media_temperature_threshold, \ "set smart media temperature threshold", \ "set threshold value for smart media temperature"), \ -OPT_STRING('x', "media-temperature-alarm", ¶m.media_temperature_alarm, \ +OPT_STRING('\0', "media-temperature-alarm", ¶m.media_temperature_alarm, \ "smart media temperature alarm", \ "enable or disable the smart media temperature alarm"), \ OPT_STRING('c', "ctrl-temperature", ¶m.ctrl_temperature, \ @@ -83,7 +83,7 @@ OPT_STRING('C', "ctrl-temperature-threshold", \ ¶m.ctrl_temperature_threshold, \ "set smart controller temperature threshold", \ "set threshold value for smart controller temperature"), \ -OPT_STRING('y', "ctrl-temperature-alarm", ¶m.ctrl_temperature_alarm, \ +OPT_STRING('\0', "ctrl-temperature-alarm", ¶m.ctrl_temperature_alarm, \ "smart controller temperature alarm", \ "enable or disable the smart controller temperature alarm"), \ OPT_STRING('s', "spares", ¶m.spares, \ @@ -92,13 +92,14 @@ OPT_STRING('s', "spares", ¶m.spares, \ OPT_STRING('S', "spares-threshold", ¶m.spares_threshold, \ "set smart spares threshold", \ "set a threshold value for smart spares"), \ -OPT_STRING('z', "spares-alarm", ¶m.spares_alarm, \ +OPT_STRING('\0', "spares-alarm", ¶m.spares_alarm, \ "smart spares alarm", \ "enable or disable the smart spares alarm"), \ OPT_BOOLEAN('f', "fatal", ¶m.fatal, "inject fatal smart health status"), \ OPT_BOOLEAN('U', "unsafe-shutdown", ¶m.unsafe_shutdown, \ "inject smart unsafe shutdown status") + static const struct option smart_opts[] = { SMART_OPTIONS(), OPT_END(), diff --git a/ndctl/monitor.c b/ndctl/monitor.c index b97d1ea..c6419ad 100644 --- a/ndctl/monitor.c +++ b/ndctl/monitor.c @@ -583,7 +583,7 @@ int cmd_monitor(int argc, const char **argv, void *ctx) "where to output the monitor's notification"), OPT_FILENAME('c', "config-file", &monitor.config_file, "config-file", "override the default config"), - OPT_BOOLEAN('x', "daemon", &monitor.daemon, + OPT_BOOLEAN('\0', "daemon", &monitor.daemon, "run ndctl monitor as a daemon"), OPT_BOOLEAN('u', "human", &monitor.human, "use human friendly output formats"),