From patchwork Sat Jan 24 15:07:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 432414 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2732C140291 for ; Sun, 25 Jan 2015 02:20:42 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D045828BDE7; Sat, 24 Jan 2015 16:16:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 6E17628BDBA for ; Sat, 24 Jan 2015 16:16:35 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-pd0-f179.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 24 Jan 2015 16:16:24 +0100 (CET) Received: by mail-pd0-f179.google.com with SMTP id v10so3450450pde.10 for ; Sat, 24 Jan 2015 07:18:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VL4WnQOWYe24dVhZViJh6rt3EeF3q9gjtIRmhmgEWzY=; b=aprU2K/bkdf6EVVFRAxqh6Lm7u/C2HkUJ/e5ACY7Mj813wfgHulBWiMK5JPAxr4Yfj 9G8mH59TIpBujFjDOUwc9enwkTf8tBEit4Xbiyju8Ij3ZHNKhr2W5TTgcnWdz5zmlHLQ jUNKRmOdVfyhNozvlZ7h6HUsMqDSttc+qFMY1dg9egqVgeEHS/Vvl6tnkrPMd4m14NyQ gCVuYJ5gobhn01f18QeGyZCRc5FGa7SNTbiCwXnYRWaSNvpOEAv3X9yGGcc33OW/6foz jH2JsnkxW5UwLwq62mKDB6YyqOZ+/tWs1xKrAsi9IJwO9mNvbvVtCpdVqVuYnXq+n3TP UZuw== X-Received: by 10.66.235.137 with SMTP id um9mr15093257pac.89.1422112722924; Sat, 24 Jan 2015 07:18:42 -0800 (PST) Received: from debian.corp.sankuai.com ([103.29.140.56]) by mx.google.com with ESMTPSA id oi5sm5089119pbb.7.2015.01.24.07.18.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Jan 2015 07:18:41 -0800 (PST) From: Yousong Zhou To: nbd@openwrt.org Date: Sat, 24 Jan 2015 23:07:52 +0800 Message-Id: <1422112073-24903-4-git-send-email-yszhou4tech@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1422112073-24903-1-git-send-email-yszhou4tech@gmail.com> References: <1422112073-24903-1-git-send-email-yszhou4tech@gmail.com> Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH 3/4] cli: enhance "uci show" command on nonexistent sections and options. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" When doing "uci show network.nilsection", the current behaviour is that uci will emit a error message complaining "Entry not found", then continue to show all content of the package network itself. This is couter-intuition. Signed-off-by: Yousong Zhou --- cli.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cli.c b/cli.c index 8f32255..b647f77 100644 --- a/cli.c +++ b/cli.c @@ -314,6 +314,7 @@ static int package_cmd(int cmd, char *tuple) if (!(ptr.flags & UCI_LOOKUP_COMPLETE)) { ctx->err = UCI_ERR_NOTFOUND; cli_perror(); + goto out; } switch(e->type) { case UCI_TYPE_PACKAGE: