From: Norbert Moutarde Date: Fri, 28 Jun 2013 10:10:45 +0000 (+0200) Subject: added alias.sql X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=3ffc2e7c5b08d2158add826c80baf2acaba741c9;p=diary-shell.git added alias.sql --- diff --git a/README.md b/README.md index 5c4eb54..86eaf52 100644 --- a/README.md +++ b/README.md @@ -4,5 +4,7 @@ diary-shell 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" diff --git a/alias.sql b/alias.sql new file mode 100644 index 0000000..55d761d --- /dev/null +++ b/alias.sql @@ -0,0 +1 @@ +INSERT INTO alias (nom, cmd, argc) VALUES ('ls', 'select id,texte from raw order by date asc;', 0) diff --git a/main.cpp b/main.cpp index c03a134..777803e 100644 --- a/main.cpp +++ b/main.cpp @@ -71,7 +71,6 @@ do{ diary.exec(a); diary.print(); } - /* alias (select command from alias where 'nom'=string */ else if (diary.alias(words)); else { diary.insert(words); diff --git a/sqldb.cpp b/sqldb.cpp index 81b851b..df514a9 100644 --- a/sqldb.cpp +++ b/sqldb.cpp @@ -219,7 +219,7 @@ res = PQexecParams(conn, 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 */ @@ -246,7 +246,7 @@ bool sqlpg::alias(vector a){ if (PQntuples(res)<1)return 0; string cmd2; cmd2=PQgetvalue(res, 0, 0); - //cout<<"cmd2="<