-INSERT INTO alias (nom, command, argc) VALUES ('ls', 'select id,texte from raw order by date asc;', 0);
+INSERT INTO alias (nom, command, argc, help) VALUES ('ls', 'select id,texte from raw order by date asc;', 0, 'liste les enregistrement (select by ID, between 2 date, everyone)');
insert into alias (nom, command, argc) values ('ls', 'select * from raw where id=$1 order by date asc;', 1);
insert into alias (nom, command, argc) values ('ls', 'select * from raw where date between $1 and $2 order by date asc;', 2);
-INSERT INTO alias (nom, command, argc) VALUES ('search', 'select id,texte from raw where texte ~ $1 order by date asc;', 1);
-INSERT INTO alias (nom, command, argc) VALUES ('rm', 'DELETE FROM raw WHERE id =$1;', 1);
-INSERT INTO alias (nom, command, argc) VALUES ('alias', 'select nom from alias;', 0);
-insert into alias (nom, command, argc) values ('var', 'select nom from var', 0);
-insert into alias (nom, command, argc) values ('var', 'select id,nom,value from var where nom=$1 order by id', 1);
-insert into alias (nom, command, argc, inf) values ('memo', 'insert into memo (word, rem) values ($1, $2);', 1, '1');
+INSERT INTO alias (nom, command, argc, help) VALUES ('search', 'select id,texte from raw where texte ~ $1 order by date asc;', 1, 'search record who contains your arg (only one');
+INSERT INTO alias (nom, command, argc, help) VALUES ('rm', 'DELETE FROM raw WHERE id =$1;', 1, 'delete record by ID');
+INSERT INTO alias (nom, command, argc, help) VALUES ('alias', 'select nom from alias;', 0, 'print every alias''s name');
+insert into alias (nom, command, argc, help) values ('var', 'select nom from var', 0, 'print avery var/named var content');
+insert into alias (nom, command, argc) values ('var', 'select nom,value from var where nom=$1 order by id', 1);
+insert into alias (nom, command, argc, inf, help) values ('memo', 'insert into memo (word, rem) values ($1, $2);', 1, '1', 'list memo''s name/record new one/');
insert into alias (nom, command, argc) values ('memo', 'select distinct word from memo', 0);
-insert into alias (nom, command, argc) values ('mem', 'select id,rem from memo where word=$1 order by id', 1);
+insert into alias (nom, command, argc, help) values ('mem', 'select id,rem from memo where word=$1 order by id', 1, 'print memo content');
+insert into alias (nom, command, argc, help) values ('help', 'select distinct nom from alias', 0, 'help itself (add "command to get specific help")');
+insert into alias (nom, command, argc) values ('help', 'select distinct id,nom,command from alias where nom=$1', 1);
ss>>y>>"-">>m>>"-">>d>>" ">>h>>":">>m>>":">>s>>".">>x;
return ss.str();*/
}
-void help()
-{
-
- cout<<"command in c++ : value, print, status, help, alias (-/+list/+add), ! SQL...\n";
- cout<<"command in SQL : \n";
-}
-
-
-
int main(int argc, char *argv[])
{
cout << "Début du programme '" << argv[0] << "'. Nombre de paramètres reçus : " << argc << endl;
if(words.size()==0)break;//quit
else if (words[0]=="w") diary.exec(words);
else if (words[0]=="p") diary.print();
- else if (words[0]=="help") help();
+ //else if (words[0]=="help") diary.help(); now into SQL
else if (words[0]=="status") diary.status();
else if (words[0]=="value") diary.var();