17_kcontext draft

This commit is contained in:
2023-09-23 23:11:09 +08:00
parent 3395589b9e
commit b134d89d40
2 changed files with 109 additions and 1 deletions

View File

@@ -20,6 +20,8 @@ if [ -f "$RBASH_HOME/keystore.secret" ]; then
_AUTH_SECRET=$( cat "$RBASH_HOME/keystore.secret" )
fi
complete -W "add del get list query update search secret sync" kstore
function kstore {
case $1 in
add) shift; kstore-add "$@" ;;
@@ -260,6 +262,7 @@ function kstore-get {
$_SQLITE -list "$_AUTH_DB" "SELECT ( data ) FROM store WHERE $_cond;" | kstore-dec
else
echo "\"$1\" not found" >&2
return 1
fi
}
@@ -330,5 +333,5 @@ function kstore-list {
}
function kstore-query {
sqlite3 "$_AUTH_DB" "$@"
$_SQLITE "$_AUTH_DB" "$@"
}