Cleanup: Removed 'define' command

This commit is contained in:
Paul Beckingham 2016-04-07 08:01:57 -04:00
parent 55030dd010
commit 893159b209
5 changed files with 0 additions and 87 deletions

View file

@ -9,7 +9,6 @@ set (commands_SRCS CmdClear.cpp
CmdConfig.cpp
CmdContinue.cpp
CmdDefault.cpp
CmdDefine.cpp
CmdDiagnostics.cpp
CmdExport.cpp
CmdExtensions.cpp

View file

@ -1,82 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
//
// 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 <cmake.h>
#include <commands.h>
#include <shared.h>
#include <format.h>
#include <iostream>
////////////////////////////////////////////////////////////////////////////////
// timew define holidays <locale>|none
// timew define holidays [work] <date>
// timew define week <day>[- <day>] [, <day>] ...
// timew define day [<day>] start|end <time>
//
// timew define tag <tag> description <string>
// timew define tag <tag> start|end <date>
// timew define tag <tag> budget <number> <units> per <unit>
// timew define tag <tag> budget <number> <units> total
// timew define tag <tag> overlap
// timew define tag <tag> color <color>
//
int CmdDefine (
CLI& cli,
Rules& rules,
Database& database)
{
auto words = cli.getWords ();
if (words.size () >= 1)
{
std::vector <std::string> subcommands = {"holidays", "week", "day", "tag"};
std::vector <std::string> matches;
autoComplete (words[0], subcommands, matches);
if (matches.size () != 1)
throw format ("Unrecognized definition '{1}'.", words[0]);
if (matches[0] == "holidays")
{
std::cout << "# define holidays ...\n";
}
else if (matches[0] == "week")
{
std::cout << "# define week ...\n";
}
else if (matches[0] == "day")
{
std::cout << "# define day ...\n";
}
else if (matches[0] == "tag")
{
std::cout << "# define tag ...\n";
}
}
return 0;
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -45,7 +45,6 @@ int CmdHelpUsage ()
// TODO clear
// TODO config
// TODO define
// TODO gaps
// TODO help
// TODO import
@ -93,7 +92,6 @@ int CmdHelp (CLI& cli)
<< "\n"
<< "See also 'start', 'stop'.\n"
<< "\n";
// TODO define
// Ruler 1 2 3 4 5 6 7 8
// 12345678901234567890123456789012345678901234567890123456789012345678901234567890

View file

@ -36,7 +36,6 @@ int CmdClear ( );
int CmdConfig ( );
int CmdContinue ( Rules&, Database& );
int CmdDefault ( Rules&, Database& );
int CmdDefine (CLI&, Rules&, Database& );
int CmdDiagnostics ( Rules&, Database&, Extensions&);
int CmdExport (CLI&, Rules&, Database& );
int CmdExtensions ( Rules&, Extensions&);

View file

@ -190,7 +190,6 @@ int dispatchCommand (
if (command == "clear") status = CmdClear ( );
else if (command == "config") status = CmdConfig ( );
else if (command == "continue") status = CmdContinue ( rules, database );
else if (command == "define") status = CmdDefine (cli, rules, database );
else if (command == "diagnostics") status = CmdDiagnostics ( rules, database, extensions);
else if (command == "export") status = CmdExport (cli, rules, database );
else if (command == "extensions") status = CmdExtensions ( rules, extensions);