From 590ca948dbe4ec41c84b94d2c062412cb50dda0d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 22 Apr 2016 17:01:06 -0400 Subject: [PATCH] CmdReportDay: Added stubbed command --- src/commands/CMakeLists.txt | 1 + src/commands/CmdReportDay.cpp | 41 +++++++++++++++++++++++++++++++++++ src/commands/commands.h | 2 ++ src/init.cpp | 5 +++++ 4 files changed, 49 insertions(+) create mode 100644 src/commands/CmdReportDay.cpp diff --git a/src/commands/CMakeLists.txt b/src/commands/CMakeLists.txt index 89276d10..fdef4f44 100644 --- a/src/commands/CMakeLists.txt +++ b/src/commands/CMakeLists.txt @@ -16,6 +16,7 @@ set (commands_SRCS CmdClear.cpp CmdHelp.cpp CmdImport.cpp CmdReport.cpp + CmdReportDay.cpp CmdStart.cpp CmdStop.cpp CmdTags.cpp diff --git a/src/commands/CmdReportDay.cpp b/src/commands/CmdReportDay.cpp new file mode 100644 index 00000000..3a3e165b --- /dev/null +++ b/src/commands/CmdReportDay.cpp @@ -0,0 +1,41 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2015 - 2016, Paul Beckingham, Federico Hernandez. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// http://www.opensource.org/licenses/mit-license.php +// +//////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +//////////////////////////////////////////////////////////////////////////////// +int CmdReportDay ( + const CLI& cli, + Rules& rules, + Database& database) +{ + std::cout << "# CmdReportDay\n"; + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/commands/commands.h b/src/commands/commands.h index 124e94f9..59f20af8 100644 --- a/src/commands/commands.h +++ b/src/commands/commands.h @@ -50,4 +50,6 @@ int CmdTags ( Rules&, Database& ); int CmdTrack (const CLI&, Rules&, Database& ); int CmdUndo ( ); +int CmdReportDay (const CLI&, Rules&, Database& ); + #endif diff --git a/src/init.cpp b/src/init.cpp index 205d9747..d4720e47 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -73,6 +73,10 @@ void initializeEntities (CLI& cli) cli.entity ("command", "track"); cli.entity ("command", "undo"); + // Some command list themselves as extensions, to integrate with the real + // extensions. + cli.entity ("extension", "day"); + // Hint entities. cli.entity ("hint", ":debug"); cli.entity ("hint", ":quiet"); @@ -238,6 +242,7 @@ int dispatchCommand ( else if (command == "help") status = CmdHelp (cli ); else if (command == "import") status = CmdImport ( ); else if (command == "report") status = CmdReport (cli, rules, database, extensions); + else if (command == "day") status = CmdReportDay (cli, rules, database ); else if (command == "start") status = CmdStart (cli, rules, database ); else if (command == "stop") status = CmdStop (cli, rules, database ); else if (command == "tags") status = CmdTags ( rules, database );