From patchwork Thu Jul 15 21:14:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12977 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id BA742C3226 for ; Thu, 15 Jul 2021 21:15:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 141266853F; Thu, 15 Jul 2021 23:15:13 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="WY4LpPg+"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 87A2868543 for ; Thu, 15 Jul 2021 23:15:06 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 21D2E340 for ; Thu, 15 Jul 2021 23:15:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626383706; bh=B9fjfrSkPUoFdIP3KHkYWUVgzaDolzIhMIlVMa91eRI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WY4LpPg+E0/TiqlSsW9U/w2oz21oH6H0WUj4BBh4OAhtzadqRd5DlNdE7W3VuOUCm 6A9yUOSAn0omSZ9PrHihAlzmESX/2C15zYJSbk2/LG9ZYSqOt8ZMWL/rswsv69avAf 8Eyt9BgUScvBuCHYaBW5hBdC78PBmZt4GnH7yCHA= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 00:14:32 +0300 Message-Id: <20210715211459.19373-7-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715211459.19373-1-laurent.pinchart@ideasonboard.com> References: <20210715211459.19373-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 06/33] cam: options: Slit OptionsParser::usage() in two functions X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" To prepare for code reuse, split the printing of options out of OptionsParser::usage() to a separate function. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/cam/options.cpp | 12 +++++++++--- src/cam/options.h | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/cam/options.cpp b/src/cam/options.cpp index 721a808ac859..350c8084f75f 100644 --- a/src/cam/options.cpp +++ b/src/cam/options.cpp @@ -902,8 +902,6 @@ OptionsParser::Options OptionsParser::parse(int argc, char **argv) */ void OptionsParser::usage() { - std::cerr << "Options:" << std::endl; - unsigned int indent = 0; for (const Option &option : options_) { @@ -923,7 +921,15 @@ void OptionsParser::usage() indent = (indent + 7) / 8 * 8; - for (const Option &option : options_) { + std::cerr << "Options:" << std::endl; + + usageOptions(options_, indent); +} + +void OptionsParser::usageOptions(const std::list