a modern diary
to get a full source tree, type : git clone https://github.com/Nothing2Do.eu/diary-shell.git
+
cd to diary-shell, ./howto-compile.sh should compile it under diary-shell !
+
to put you modification to the server : "git commit -a" and "git push"
--- /dev/null
+INSERT INTO alias (nom, cmd, argc) VALUES ('ls', 'select id,texte from raw order by date asc;', 0)
diary.exec(a);
diary.print();
}
- /* alias (select command from alias where 'nom'=string */
else if (diary.alias(words));
else {
diary.insert(words);
int paramLengths[1];
int paramFormats[1];
//uint32_t binaryIntVal;
-paramValues[0]=a[1].c_str();
+ paramValues[0]=a[1].c_str();
res = PQexecParams(conn,
"SELECT * FROM raw WHERE texte like %$1%",
1, /* one param */
if (PQntuples(res)<1)return 0;
string cmd2;
cmd2=PQgetvalue(res, 0, 0);
- //cout<<"cmd2="<<cmd2<<endl;
+ cout<<"cmd2="<<cmd2<<endl;
int pos=0;
stringstream tmp;
int argc;
--CREATE DATABASE bob OWNER bob;
create table words (
-id serial,
+id serial primary key,
time integer,
-txt text
-);
+word text
+);
create table alias (
id serial primary key,
-command text,
+cmd text,
argc integer,
nom text
-);
+);
create table raw (
id serial primary key,