From patchwork Mon May 16 18:30:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 9104921 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 031CEBF29F for ; Mon, 16 May 2016 18:31:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 02F422026C for ; Mon, 16 May 2016 18:31:45 +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 F3F4C20268 for ; Mon, 16 May 2016 18:31:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E84671A1F74; Mon, 16 May 2016 11:31:47 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ml01.01.org (Postfix) with ESMTP id A9DB81A1F74 for ; Mon, 16 May 2016 11:31:46 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 16 May 2016 11:31:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,627,1459839600"; d="scan'208";a="703958094" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.14]) by FMSMGA003.fm.intel.com with ESMTP; 16 May 2016 11:31:42 -0700 Subject: [ndctl PATCH] ndctl: filter out unit tests from command list From: Dan Williams To: linux-nvdimm@lists.01.org Date: Mon, 16 May 2016 11:30:55 -0700 Message-ID: <146342345578.22015.9381479390986560627.stgit@dwillia2-desk3.amr.corp.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=-3.3 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 Don't provide autocomplete help for unit test commands that are not meant to be invoked in typical usage. Signed-off-by: Dan Williams Reviewed-by: Johannes Thumshirn --- ndctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ndctl.c b/ndctl.c index 6db1b2ffa0c0..bf0754cb454c 100644 --- a/ndctl.c +++ b/ndctl.c @@ -74,6 +74,14 @@ static int handle_options(const char ***argv, int *argc) for (i = 0; i < ARRAY_SIZE(commands); i++) { struct cmd_struct *p = commands+i; + + /* filter out commands from auto-complete */ + if (strcmp(p->cmd, "create-nfit") == 0) + continue; + if (strcmp(p->cmd, "test") == 0) + continue; + if (strcmp(p->cmd, "bat") == 0) + continue; printf("%s\n", p->cmd); } exit(0);