Scheduler: Add ClockService::clock_type interval console parser
[senf.git] / Scheduler / Console / ProgramOptions.cc
index 6eb3107..63bcfb1 100644 (file)
@@ -29,6 +29,7 @@
 // Custom includes
 #include <boost/algorithm/string/predicate.hpp>
 #include <boost/format.hpp>
+#include "../../Utils/range.hh"
 
 //#include "ProgramOptions.mpp"
 #define prefix_
@@ -49,7 +50,7 @@ prefix_ void senf::console::detail::ProgramOptionsSource::v_parse(RestrictedExec
         nonOptions_->clear();
     if (argc_ <= 1)
         return;
-    char ** argp (argv_+1);
+    char const ** argp (argv_+1);
     int n (argc_-1);
     for (; n; --n, ++argp) {
         std::string arg (*argp);
@@ -115,7 +116,7 @@ senf::console::detail::ProgramOptionsSource::parseLongOption(std::string const &
             std::string key (name.substr(b,e-b));
             if (! cwd->hasChild(key)) {
                 DirectoryNode::ChildrenRange completions (cwd->completions(key));
-                if (completions.size() == 1)
+                if (has_one_elt(completions))
                     key = completions.begin()->first;
                 else
                     continue;
@@ -151,7 +152,7 @@ senf::console::detail::ProgramOptionsSource::parseNonOption(std::string const &
 
 ///////////////////////////////////////////////////////////////////////////
 
-prefix_ void senf::console::parseOptions(int argc, char ** argv, DirectoryNode & root)
+prefix_ void senf::console::parseOptions(int argc, char const ** argv, DirectoryNode & root)
 {
     ProgramOptions opts (argc, argv, root);
     opts.parse();