mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-31 05:47:18 +02:00
Code Cleanup
- Removed unused text.cpp guess function.
This commit is contained in:
parent
f17c59b1f6
commit
6303f1c436
2 changed files with 0 additions and 32 deletions
31
src/text.cpp
31
src/text.cpp
|
@ -475,37 +475,6 @@ const char* optionalBlankLine ()
|
||||||
return context.verbose ("blank") ? newline : noline;
|
return context.verbose ("blank") ? newline : noline;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
void guess (
|
|
||||||
const std::string& type,
|
|
||||||
std::vector<std::string>& options,
|
|
||||||
std::string& candidate)
|
|
||||||
{
|
|
||||||
std::vector <std::string> matches;
|
|
||||||
autoComplete (candidate, options, matches,
|
|
||||||
context.config.getInteger ("abbreviation.minimum"));
|
|
||||||
if (1 == matches.size ())
|
|
||||||
candidate = matches[0];
|
|
||||||
|
|
||||||
else if (0 == matches.size ())
|
|
||||||
candidate = "";
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::sort (matches.begin (), matches.end ());
|
|
||||||
|
|
||||||
std::string error = format (STRING_TEXT_AMBIGUOUS, type, candidate);
|
|
||||||
for (size_t i = 0; i < matches.size (); ++i)
|
|
||||||
{
|
|
||||||
if (i)
|
|
||||||
error += ", ";
|
|
||||||
error += matches[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool nontrivial (const std::string& input)
|
bool nontrivial (const std::string& input)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,6 @@ std::string ucFirst (const std::string&);
|
||||||
const std::string str_replace (std::string&, const std::string&, const std::string&);
|
const std::string str_replace (std::string&, const std::string&, const std::string&);
|
||||||
const std::string str_replace (const std::string&, const std::string&, const std::string&);
|
const std::string str_replace (const std::string&, const std::string&, const std::string&);
|
||||||
const char* optionalBlankLine ();
|
const char* optionalBlankLine ();
|
||||||
void guess (const std::string&, std::vector<std::string>&, std::string&);
|
|
||||||
bool nontrivial (const std::string&);
|
bool nontrivial (const std::string&);
|
||||||
bool digitsOnly (const std::string&);
|
bool digitsOnly (const std::string&);
|
||||||
bool noSpaces (const std::string&);
|
bool noSpaces (const std::string&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue