mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
CLI
- Further restrictions on tag definition.
This commit is contained in:
parent
39983e5f82
commit
55962058de
1 changed files with 2 additions and 3 deletions
|
@ -28,7 +28,6 @@
|
|||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <iostream> // TODO Remove.
|
||||
#include <ctype.h>
|
||||
#include <Context.h>
|
||||
#include <Nibbler.h>
|
||||
#include <Lexer.h>
|
||||
|
@ -2069,12 +2068,12 @@ bool CLI::isCommand (const std::string& raw) const
|
|||
// Valid tag
|
||||
// - Length > 1
|
||||
// - Starts with +/-
|
||||
// - Tag does not start with a digit
|
||||
// - The rest matches ::isName
|
||||
bool CLI::isTag (const std::string& raw) const
|
||||
{
|
||||
if (raw.size () >= 2 &&
|
||||
(raw[0] == '+' || raw[0] == '-') &&
|
||||
! isdigit(raw[1]) &&
|
||||
isName (raw.substr (1)) &&
|
||||
raw.find (' ') == std::string::npos)
|
||||
return true;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue