CmdReport: Converted to CLI

This commit is contained in:
Paul Beckingham 2016-04-03 21:53:49 -04:00
parent b7af901661
commit 7715b5fb23
3 changed files with 13 additions and 12 deletions

View file

@ -64,16 +64,17 @@ static std::string findExtension (
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
int CmdReport ( int CmdReport (
const std::vector <std::string>& args, CLI& cli,
Rules& rules, Rules& rules,
Database& database, Database& database,
Extensions& extensions, Extensions& extensions,
Log& log) Log& log)
{ {
// TODO Identify report. // TODO Identify report.
if (args.size () > 2) auto words = cli.getWords ();
if (words.size ())
{ {
auto script = findExtension (extensions, args[2]); auto script = findExtension (extensions, words[0]);
// TODO Default report? // TODO Default report?

View file

@ -48,7 +48,7 @@ int CmdHelpUsage (
int CmdHelp (CLI&, Log&); int CmdHelp (CLI&, Log&);
int CmdLog (CLI&, Log&); int CmdLog (CLI&, Log&);
int CmdImport ( ); int CmdImport ( );
int CmdReport (const std::vector <std::string>&, Rules&, Database&, Extensions&, Log&); int CmdReport (CLI&, Rules&, Database&, Extensions&, Log&);
int CmdStart (const std::vector <std::string>&, Rules&, Database&, Log&); int CmdStart (const std::vector <std::string>&, Rules&, Database&, Log&);
int CmdStop (const std::vector <std::string>&, Rules&, Database&, Log&); int CmdStop (const std::vector <std::string>&, Rules&, Database&, Log&);
int CmdTags ( Rules&, Database&, Log&); int CmdTags ( Rules&, Database&, Log&);

View file

@ -223,7 +223,7 @@ int dispatchCommand (
else if (command == "help") status = CmdHelp (cli, log); else if (command == "help") status = CmdHelp (cli, log);
else if (command == "import") status = CmdImport ( ); else if (command == "import") status = CmdImport ( );
else if (command == "log") status = CmdLog (cli, log); else if (command == "log") status = CmdLog (cli, log);
else if (command == "report") status = CmdReport (args, rules, database, extensions, log); else if (command == "report") status = CmdReport (cli, rules, database, extensions, log);
else if (command == "start") status = CmdStart (args, rules, database, log); else if (command == "start") status = CmdStart (args, rules, database, log);
else if (command == "stop") status = CmdStop (args, rules, database, log); else if (command == "stop") status = CmdStop (args, rules, database, log);
else if (command == "tags") status = CmdTags ( rules, database, log); else if (command == "tags") status = CmdTags ( rules, database, log);