From 2ca6cc0bfcda23d808c5f259cd8755f5fccab6c0 Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Sun, 14 Jul 2013 16:22:59 +0200 Subject: [PATCH] mem don't need to exist anymore ! replaced by "memo " --- alias.sql | 5 +++-- sqldb.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/alias.sql b/alias.sql index e79e4c3..6702bab 100644 --- a/alias.sql +++ b/alias.sql @@ -6,8 +6,9 @@ INSERT INTO alias (nom, command, argc, help) VALUES ('rm', 'DELETE FROM raw WHER 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, inf, help) values ('memo', 'insert into memo (word, rem) values ($1, $2);', 1, '1', 'list memo''s name'); insert into alias (nom, command, argc) values ('memo', 'select distinct word from memo', 0); -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 ('memo', '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); +insert into alias (nom, command, argc) values ('help', 'select id,nom,command from alias where nom=$1 and argc=$2', 1); diff --git a/sqldb.cpp b/sqldb.cpp index 4b5aed5..dd142b1 100644 --- a/sqldb.cpp +++ b/sqldb.cpp @@ -241,7 +241,7 @@ inline int sqlpg::testSQL(PGresult* a){ } bool sqlpg::alias(vector a){ clog<<"alias start here\n"; - string nom=a[0], as=toString(a.size()-1).c_str(), i; + string nom=a[0], as=toString(a.size()-1), i; int argca=2, inf=0; const char *valuea[2]={nom.c_str(), as.c_str()}; int lengtha[2]={nom.size(), as.size()}; @@ -275,9 +275,9 @@ bool sqlpg::alias(vector a){ clog<<"for finish, \n"; if(inf==1){ clog<<"inf==1\n"; - t=a[argc+1]; - clog<<"for infinite (j="<