diff --git a/bash/bashrc/sources/16_keystore b/bash/bashrc/sources/16_keystore index 4142b20..d75ac69 100644 --- a/bash/bashrc/sources/16_keystore +++ b/bash/bashrc/sources/16_keystore @@ -33,10 +33,10 @@ function kstore { *) __func_head "add [key] [value|file|-] [prop, default: $_KSTORE_DEF_PROP]" __func_help "update [key] [value|file|-] [prop, default: $_KSTORE_DEF_PROP]" - __func_help "get key [prop, default: $_KSTORE_DEF_PROP]" + __func_help "get [key] [prop, default: $_KSTORE_DEF_PROP]" + __func_help "del [key]" __func_help "list" - __func_help "del key" - __func_help "search key" + __func_help "search [key] [prop]" __func_help "secret ..." __func_help "query SQL" return 1 @@ -288,7 +288,12 @@ function kstore-del { } function kstore-search { - echo "Not implemented yet" + local _termk _termp _cond + _termk=`kstore-quote "$1"` + _termp=`kstore-quote "$2"` + _cond="key LIKE '%$_termk%' AND prop LIKE '%$_termp%'" + + $_SQLITE -header -column "$_AUTH_DB" "SELECT key, prop, length( data ) FROM store WHERE $_cond;" } function kstore-list {