From patchwork Thu Apr 7 01:07:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 8767871 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 035349F36E for ; Thu, 7 Apr 2016 01:08:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26CFD2013A for ; Thu, 7 Apr 2016 01:08:08 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 4DF722008F for ; Thu, 7 Apr 2016 01:08:07 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 43EEE1A1FC5; Wed, 6 Apr 2016 18:08:07 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ml01.01.org (Postfix) with ESMTP id 0542B1A1F6C for ; Wed, 6 Apr 2016 18:08:05 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 06 Apr 2016 18:08:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,448,1455004800"; d="scan'208";a="953331252" Received: from dwillia2-desk3.jf.intel.com ([10.54.39.14]) by fmsmga002.fm.intel.com with ESMTP; 06 Apr 2016 18:08:06 -0700 Subject: [ndctl PATCH 3/5] ndctl, list: clean up default behavior From: Dan Williams To: linux-nvdimm@lists.01.org Date: Wed, 06 Apr 2016 18:07:14 -0700 Message-ID: <20160407010714.30641.19033.stgit@dwillia2-desk3.jf.intel.com> In-Reply-To: <20160407010659.30641.26139.stgit@dwillia2-desk3.jf.intel.com> References: <20160407010659.30641.26139.stgit@dwillia2-desk3.jf.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Only list namespaces by default when no other option is specified. Otherwise, to limit the listing to dimm info a user would need to run: ndctl list --dimms --no-namespaces ...with the change this is reduced to: ndctl list --dimms Signed-off-by: Dan Williams Reviewed-by: Johannes Thumshirn --- Documentation/ndctl-list.txt | 2 +- builtin-list.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Documentation/ndctl-list.txt b/Documentation/ndctl-list.txt index abf3ff07cfa9..806548196118 100644 --- a/Documentation/ndctl-list.txt +++ b/Documentation/ndctl-list.txt @@ -79,7 +79,7 @@ include::xable-region-options.txt[] -N:: --namespaces:: Include namespace info in the listing. Namespace info is - included by default, specify '--no-namespaces' to omit. + listed by default if no other options are specified to the command. -i:: --idle:: diff --git a/builtin-list.c b/builtin-list.c index 413b36ac0208..df0871ab544a 100644 --- a/builtin-list.c +++ b/builtin-list.c @@ -22,9 +22,7 @@ static struct { bool regions; bool namespaces; bool idle; -} list = { - .namespaces = true, -}; +} list; static struct { const char *bus; @@ -222,6 +220,9 @@ int cmd_list(int argc, const char **argv) unsigned int type = 0; int i, rc; + if (argc == 1) + list.namespaces = true; + argc = parse_options(argc, argv, options, u, 0); for (i = 0; i < argc; i++) error("unknown parameter \"%s\"\n", argv[i]);