Cleanup: Removed calls superceded by CLI

This commit is contained in:
Paul Beckingham 2016-04-03 17:46:49 -04:00
parent 024a9c2f39
commit 6ca48808a8
6 changed files with 1 additions and 114 deletions

View file

@ -15,7 +15,6 @@ set (timew_SRCS CLI.cpp CLI.h
Lexer.cpp Lexer.h
Rules.cpp Rules.h
Timeline.cpp Timeline.h
classifier.cpp
init.cpp
helper.cpp
util.cpp)

View file

@ -1,59 +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 <timew.h>
////////////////////////////////////////////////////////////////////////////////
std::vector <std::string> getHints (const std::vector <std::string>& args)
{
std::vector <std::string> hints;
for (auto& arg : args)
if (arg[0] == ':')
hints.push_back (arg);
return hints;
}
////////////////////////////////////////////////////////////////////////////////
// enum class ArgType { binary, command, positional, hint };
ArgType classifyArg (const std::string& arg)
{
if (arg.find ("timew") == arg.length () - 5 ||
arg.find ("ti") == arg.length () - 2)
return ArgType::binary;
// TODO Commands are a problem.
if (arg[0] == ':')
return ArgType::hint;
// The positional args are really just the remainder after the others are
// excluded.
return ArgType::positional;
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -42,12 +42,6 @@ void initializeDataAndRules (Database&, Rules&, Log&);
void initializeExtensions (Rules&, Extensions&, Log&);
int dispatchCommand (const std::vector <std::string>&, CLI&, Database&, Rules&, Extensions&, Log&);
// classifier.cpp
std::vector <std::string> getHints (const std::vector <std::string>&);
enum class ArgType { binary, command, positional, hint };
ArgType classifyArg (const std::string&);
// helper.cpp
Color tagColor (const Rules&, const std::string&);
std::string intervalSummarize (const Rules&, const Interval&);