- Restored default.command in ::injectDefaults.
- Restored 'information' command when an ID/UUID is provided, but no CMD.
This commit is contained in:
Paul Beckingham 2014-09-07 14:37:44 -04:00
parent ac73a47f9b
commit 9e3a8e5c82

View file

@ -550,25 +550,21 @@ void Parser::injectDefaults ()
// arguments. // arguments.
bool found_command = false; bool found_command = false;
bool found_sequence = false; bool found_sequence = false;
bool found_other = false; bool found_terminator = false;
std::vector <Tree*> nodes; std::vector <Tree*> nodes;
collect (nodes, collectTerminated); collect (nodes, collectAll);
std::vector <Tree*>::iterator i; std::vector <Tree*>::iterator i;
for (i = nodes.begin (); i != nodes.end (); ++i) for (i = nodes.begin (); i != nodes.end (); ++i)
{ {
if ((*i)->hasTag ("BINARY")) if ((*i)->attribute ("raw") == "--")
; found_terminator = true;
else if ((*i)->hasTag ("CMD")) if (! found_terminator && (*i)->hasTag ("CMD"))
found_command = true; found_command = true;
else if ((*i)->hasTag ("ID") || (*i)->hasTag ("UUID")) else if (! found_terminator && ((*i)->hasTag ("ID") || (*i)->hasTag ("UUID")))
found_sequence = true; found_sequence = true;
else if (! (*i)->hasTag ("RC") &&
! (*i)->hasTag ("CONFIG"))
found_other = true;
} }
// If no command was specified, then a command will be inserted. // If no command was specified, then a command will be inserted.
@ -618,11 +614,6 @@ void Parser::injectDefaults ()
} }
} }
else else
{
// TODO There is a problem, in that this block is not run.
// Information command.
if (! found_other)
{ {
context.debug ("Sequence but no command found - assuming 'information' command."); context.debug ("Sequence but no command found - assuming 'information' command.");
context.header (STRING_ASSUME_INFO); context.header (STRING_ASSUME_INFO);
@ -630,7 +621,6 @@ void Parser::injectDefaults ()
t->tag ("ASSUMED"); t->tag ("ASSUMED");
} }
} }
}
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////