From 065b767b6e658702dfac696cd752cca6190a4610 Mon Sep 17 00:00:00 2001 From: Lei YU Date: Thu, 19 Apr 2018 10:59:40 +0800 Subject: Make --continue as no_argument This is an improvement for the previous commit, that make --continue option as no_argument. Tested: phosphor-gpio-monitor is able to run with or without --continue argument, and it it continues to run after key press with this argument. Change-Id: I6f9dc5423e19eace366e382a2408dd143a124915 Signed-off-by: Lei YU --- argument.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/argument.cpp b/argument.cpp index d388001..c47dcd9 100644 --- a/argument.cpp +++ b/argument.cpp @@ -37,7 +37,7 @@ const option ArgumentParser::options[] = { "key", required_argument, nullptr, 'k' }, { "polarity", required_argument, nullptr, 'r' }, { "target", required_argument, nullptr, 't' }, - { "continue", optional_argument, nullptr, 'c' }, + { "continue", no_argument, nullptr, 'c' }, { "help", no_argument, nullptr, 'h' }, { 0, 0, 0, 0}, }; @@ -94,7 +94,7 @@ void ArgumentParser::usage(char** argv) " This is 0 / 1 \n"; std::cerr << " --target= Systemd unit to be called on GPIO" " state change\n"; - std::cerr << " --continue=[true] Whether or not to continue" + std::cerr << " [--continue] Whether or not to continue" " after key pressed\n"; } } // namespace gpio -- cgit v1.2.1