added kstore-search
This commit is contained in:
		@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user