break;
}
else if (boost::algorithm::starts_with(arg, std::string("--")) && arg.size() > 2)
- parseLongOption(arg.substr(2), executor);
+ try {
+ parseLongOption(arg.substr(2), executor);
+ }
+ catch (senf::ExceptionMixin & e) {
+ e << "\nwhile parsing command line option: " << arg;
+ throw;
+ }
else if (boost::algorithm::starts_with(arg, std::string("-")) && arg.size() > 1) {
for (std::string::size_type i (1); i<arg.size(); ++i) {
char opt (arg[i]);
}
if (boost::algorithm::starts_with(longOpt, std::string("--")))
longOpt = longOpt.substr(2);
- parseLongOption(longOpt, executor);
+ try {
+ parseLongOption(longOpt, executor);
+ }
+ catch (senf::ExceptionMixin & e) {
+ e << "\nwhile parsing command line option: -" << opt << ' ' << param;
+ throw;
+ }
}
}
else
ParseCommandInfo cmd;
Path path;
-
+
DirectoryNode::ptr cwd (executor.root().thisptr());
std::string::size_type b (0);
while (b < name.size()) {
DirectoryNode::ChildrenRange completions (cwd->completions(key));
if (has_one_elt(completions))
key = completions.begin()->first;
- else
+ else {
+ e -= 1;
continue;
+ }
}
path.push_back(WordToken(key));
if (e < name.size())
b = name.size();
}
}
-
+
cmd.command(path);
parser_.parseArguments(value, cmd);
executor(std::cerr, cmd);