From patchwork Mon Jan 28 00:41:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 422 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B218360DB6 for ; Mon, 28 Jan 2019 01:41:32 +0100 (CET) X-Halon-ID: 65db9697-2295-11e9-911a-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 65db9697-2295-11e9-911a-0050569116f7; Mon, 28 Jan 2019 01:41:07 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Mon, 28 Jan 2019 01:41:04 +0100 Message-Id: <20190128004109.25860-2-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190128004109.25860-1-niklas.soderlund@ragnatech.se> References: <20190128004109.25860-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/6] cam: options: move enum OptionArgument X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jan 2019 00:41:33 -0000 The enumeration of the different possibilities for arguments can be used by other parser then OptionsParser. Move it outside the class to make it ready to be used by other parsers. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/cam/main.cpp | 3 +-- src/cam/options.h | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/cam/main.cpp b/src/cam/main.cpp index cb98d302dcf30331..bde47a8f17983912 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -38,8 +38,7 @@ static int parseOptions(int argc, char *argv[]) OptionsParser parser; parser.addOption(OptCamera, "Specify which camera to operate on", - "camera", OptionsParser::ArgumentRequired, - "camera"); + "camera", ArgumentRequired, "camera"); parser.addOption(OptHelp, "Display this help message", "help"); parser.addOption(OptList, "List all cameras", "list"); diff --git a/src/cam/options.h b/src/cam/options.h index f99ea7300a71c24f..491f6a316fffbe5b 100644 --- a/src/cam/options.h +++ b/src/cam/options.h @@ -11,15 +11,15 @@ #include #include +enum OptionArgument { + ArgumentNone, + ArgumentRequired, + ArgumentOptional, +}; + class OptionsParser { public: - enum OptionArgument { - ArgumentNone, - ArgumentRequired, - ArgumentOptional, - }; - class Options { public: Options();