try {
switch(command.builtin()) {
case ParseCommandInfo::NoBuiltin :
+ traverseToCommand(command.commandPath())(output, command.arguments());
break;
-
+
case ParseCommandInfo::BuiltinCD :
if ( command.arguments() ) {
if (command.arguments().begin()->size() == 1
catch (InvalidDirectoryException &) {
output << "invalid directory" << std::endl;
}
+ catch (InvalidCommandException &) {
+ output << "invalid command" << std::endl;
+ }
return true;
}
prefix_ senf::console::DirectoryNode &
-senf::console::Executor::traverseTo(ParseCommandInfo::argument_value_type const & path)
+senf::console::Executor::traverseTo (ParseCommandInfo::argument_value_type const & path)
{
try {
return dynamic_cast<DirectoryNode&>(
throw InvalidDirectoryException();
}
}
+
+prefix_ senf::console::CommandNode &
+senf::console::Executor::traverseToCommand(ParseCommandInfo::CommandPathRange const & path)
+{
+ try {
+ return dynamic_cast<CommandNode &>( cwd().traverse(path) );
+ }
+ catch (std::bad_cast &) {
+ throw InvalidCommandException();
+ }
+ catch (UnknownNodeNameException &) {
+ throw InvalidCommandException();
+ }
+}
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_