aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2017-01-10 01:23:30 +0100
committerache <ache@ache.one>2017-01-10 01:23:30 +0100
commit8f56a469d9384e255c0c65103e30a1ffa8cdc062 (patch)
treeeb3d33c09ee1a58a0dcf44127031d33b53e58b06
parentFix clean option to deal with new states (diff)
Doublon not avalible anymore
-rwxr-xr-xtodo.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/todo.cpp b/todo.cpp
index 23ba269..1a8cab9 100755
--- a/todo.cpp
+++ b/todo.cpp
@@ -154,8 +154,14 @@ int main(int argc, char *argv[]) {
if( sargv == "" ) {
cout << "Chaine vide" << endl;
break;
- } else
+ } else {
+ for ( int i = listTodo.size()-1; i >= 0 ; --i)
+ if( listTodo.at(i).str == sargv ) {
+ cerr << "Erreur doublon" << endl;
+ break;
+ }
listTodo.push_back(todoFromCmd(sargv));
+ }
break;
}