From 4c05fb3e0cada281e8c86f87b898a9e33a02db26 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 3 Apr 2016 17:22:39 -0400 Subject: [PATCH] Cleanup: Renamed 'keywords' to 'hints' which is more accurate --- src/CLI.cpp | 12 ++++++------ src/classifier.cpp | 12 ++++++------ src/init.cpp | 6 +++--- src/timew.h | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/CLI.cpp b/src/CLI.cpp index 8b8d7f6d..156d8346 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -106,7 +106,7 @@ const std::string A2::dump () const { if (tag == "BINARY") tags += "\033[1;37;44m" + tag + "\033[0m "; else if (tag == "CMD") tags += "\033[1;37;46m" + tag + "\033[0m "; - else if (tag == "KEYWORD") tags += "\033[1;37;43m" + tag + "\033[0m "; + else if (tag == "HINT") tags += "\033[1;37;43m" + tag + "\033[0m "; else tags += "\033[32m" + tag + "\033[0m "; } @@ -332,16 +332,16 @@ void CLI::canonicalizeNames () } // Commands. - if (exactMatch ("keyword", raw)) + if (exactMatch ("hint", raw)) { a.attribute ("canonical", raw); - a.tag ("KEYWORD"); + a.tag ("HINT"); continue; } - else if (canonicalize (canonical, "keyword", raw)) + else if (canonicalize (canonical, "hint", raw)) { - a.attribute ("keyword", canonical); - a.tag ("KEYWORD"); + a.attribute ("hint", canonical); + a.tag ("HINT"); continue; } } diff --git a/src/classifier.cpp b/src/classifier.cpp index 3fb209c5..35c07133 100644 --- a/src/classifier.cpp +++ b/src/classifier.cpp @@ -28,18 +28,18 @@ #include //////////////////////////////////////////////////////////////////////////////// -std::vector getKeywords (const std::vector & args) +std::vector getHints (const std::vector & args) { - std::vector keywords; + std::vector hints; for (auto& arg : args) if (arg[0] == ':') - keywords.push_back (arg); + hints.push_back (arg); - return keywords; + return hints; } //////////////////////////////////////////////////////////////////////////////// -// enum class ArgType { binary, command, positional, keyword }; +// enum class ArgType { binary, command, positional, hint }; ArgType classifyArg (const std::string& arg) { if (arg.find ("timew") == arg.length () - 5 || @@ -49,7 +49,7 @@ ArgType classifyArg (const std::string& arg) // TODO Commands are a problem. if (arg[0] == ':') - return ArgType::keyword; + return ArgType::hint; // The positional args are really just the remainder after the others are // excluded. diff --git a/src/init.cpp b/src/init.cpp index 3a987926..8d83f34b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -73,9 +73,9 @@ void initializeEntities (CLI& cli) cli.entity ("command", "track"); cli.entity ("command", "undo"); - // TODO Keyword entities. - cli.entity ("keyword", ":week"); // TODO Guess - cli.entity ("keyword", ":fill"); + // TODO Hint entities. + cli.entity ("hint", ":week"); // TODO Guess + cli.entity ("hint", ":fill"); // TODO Extension names. } diff --git a/src/timew.h b/src/timew.h index e0b8c55a..7aae9dec 100644 --- a/src/timew.h +++ b/src/timew.h @@ -43,9 +43,9 @@ void initializeExtensions (Rules&, Extensions&, Log&); int dispatchCommand (const std::vector &, CLI&, Database&, Rules&, Extensions&, Log&); // classifier.cpp -std::vector getKeywords (const std::vector &); +std::vector getHints (const std::vector &); -enum class ArgType { binary, command, positional, keyword }; +enum class ArgType { binary, command, positional, hint }; ArgType classifyArg (const std::string&); // helper.cpp