diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/sm-get-value.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/sm-get-value.cpp b/apps/sm-get-value.cpp index b813121..883495a 100644 --- a/apps/sm-get-value.cpp +++ b/apps/sm-get-value.cpp @@ -93,13 +93,14 @@ public: ~sm_get_value() = default; void add_options(po::options_description_easy_init &options) override { + auto default_sleep = po::value<>(&sleepTime)->default_value(0); + options("help", "produce help message") ("device", po::value<string>()->required(), "MAC of device to poll") ("sensor", po::value<vector<unsigned int>>(&sensors)->multitoken(), "Sensor to poll, defaults to all") - ("sleep", po::value<unsigned int>(&sleepTime)->default_value(0), - "How long to sleep in seconds between each poll. If not give, it will exit after first poll") - ("format", po::value<sample_format_type>(&format)->default_value(sample_format_type::KEY_VALUE), "Output format"); - + ("sleep", default_sleep, "How long to sleep in seconds between each poll. If not given, it will exit after first poll") + ("format", po::value<sample_format_type>(&format)->default_value(sample_format_type::KEY_VALUE), + "Output format"); } int main(app_execution &execution) override { @@ -147,8 +148,6 @@ public: return EXIT_FAILURE; } } - - }; } |