Index: trunk/kanako
===================================================================
--- trunk/kanako	(revision 13)
+++ trunk/kanako	(revision 14)
@@ -1,3 +1,4 @@
-#!/bin/sh -e
+#!/bin/sh
+# $KyokoNet: kanako,v 1.7 2022/11/26 08:44:11 akoizumi Exp $
 
 readonly kanako_conf_dir="${kanako_conf_dir:-$HOME/.config/kanako}"
@@ -23,14 +24,14 @@
 
 fn_copy() {
-    fn_view $1 | "${clip_cmd}"
+    fn_view $1 | "${kanako_clip_cmd}"
 }
 fn_edit() {
-    ${encrypt_cmd} ${decrypt_args} ${1%%.enc}.enc > ${1%%.enc}
+    ${kanako_encrypt_cmd} ${kanako_decrypt_args} ${1%%.enc}.enc > ${1%%.enc}
     "${EDITOR}" "${1%%.enc}"
-    ${encrypt_cmd} ${encrypt_args} ${1%%.enc} > ${1%%.enc}.enc
+    ${kanako_encrypt_cmd} ${kanako_encrypt_args} ${1%%.enc} > ${1%%.enc}.enc
     rm "${1%%.enc}"
 }
 fn_list() {
-    "${list_cmd}" "${store_dir}"
+    "${kanako_list_cmd}" "${kanako_store_dir}/"
 }
 fn_new() {
@@ -41,24 +42,23 @@
 
     mkdir -p "$(dirname "$1")"
-    ${encrypt_cmd} ${encrypt_args} ${tmpfile} > ${1%%.enc}.enc
+    ${kanako_encrypt_cmd} ${kanako_encrypt_args} ${tmpfile} > ${1%%.enc}.enc
     rm ${tmpfile}
 }
 fn_trash_directory() {
-    rm -rf $@
+    rm -rf "$@"
 }
-fn_trash_entry() {
+fn_trash_file() {
     rm -f "${1}${2}".enc
 }
 fn_usage() {
-    cat <<EOF
-Usage:
-kanako [-celnrRv] <arguments>
-EOF
+    printf "Usage: %s [-c|-e|-h|-l|-n|-R|-r|-v [file or directory]]\n" "$0"
+    printf "The arguments for all switches except for '-h' are relative to\n"
+    printf "\t\$kanako_store_dir which is set to %s\n\n" "{$kanako_store_dir}"
 }
 fn_view() {
     if [ -f "${1%%.enc}".enc ]; then
-	${encrypt_cmd} ${decrypt_args} "${1%%.enc}".enc
+	${kanako_encrypt_cmd} ${kanako_decrypt_args} "${1%%.enc}".enc
     elif [ -d "${1:-.}" ]; then
-	${list_cmd} "${1:-.}"
+	${kanako_list_cmd} "${1:-.}"
     else
 	fn_usage
@@ -71,6 +71,6 @@
     -l) fn_list ;;
     -n) fn_new $2 ;;
-    -r) fn_trash_entry $2 ;;
     -R) fn_trash_directory $2 ;;
+    -r) fn_trash_file $2 ;;
     -v) fn_view $2 ;;
     *) fn_usage ;;
Index: trunk/kanako.conf.example
===================================================================
--- trunk/kanako.conf.example	(revision 13)
+++ trunk/kanako.conf.example	(revision 14)
@@ -1,25 +1,25 @@
 # Configuration file for kanako(1)
 
-#clip="xclip -i"
-#clip="wl-copy --primary"
-#list_cmd="tree"
+#kanako_clip_cmd="xclip -i"
+#kanako_clip_cmd="wl-copy --primary"
+#kanako_list_cmd="tree"
 
 ## age
-#encrypt_cmd="age"
-#encrypt_args="-e -R ${key_dir}/pub.age --armor"
-#decrypt_args="-d -i ${key_dir}/priv.age"
+#kanako_encrypt_cmd="age"
+#kanako_encrypt_args="-e -R ${kanako_key_dir}/pub.key --armor"
+#kanako_decrypt_args="-d -i ${kanako_key_dir}/priv.key"
 
 ## cream
-#encrypt_cmd="cream"
-#encrypt_args="-e -f"
-#decrypt_args="-d"
+#kanako_encrypt_cmd="cream"
+#kanako_encrypt_args="-e -f"
+#kanako_decrypt_args="-d"
 
 ## gpg
-#encrypt_cmd="gpg"
-#encrypt_args="-e --recipient ${key_dir}/pub.gpg"
-#decrypt_args="-d"
+#kanako_encrypt_cmd="gpg"
+#kanako_encrypt_args="-e --recipient ${kanako_key_dir}/pub.key"
+#kanako_decrypt_args="-d"
 
 ## salty
-#encrypt_cmd="salty"
-#encrypt_args="-e -r $(cat ${key_dir}/pub.slt)"
-#decrypt_args="-d -i ${key_dir}/priv.slt"
+#kanako_encrypt_cmd="salty"
+#kanako_encrypt_args="-e -r $(cat ${kanako_key_dir}/pub.slt)"
+#kanako_decrypt_args="-d -i ${kanako_key_dir}/priv.slt"
Index: trunk/kanako.conf.mdoc
===================================================================
--- trunk/kanako.conf.mdoc	(revision 13)
+++ trunk/kanako.conf.mdoc	(revision 14)
@@ -1,3 +1,3 @@
-.Dd Bureaucracy 65, 3188
+.Dd Bureaucracy 73, 3188
 .Dt KANAKO.CONF 5
 .Os
@@ -10,9 +10,15 @@
 .Bl -tag -width 11n -compact
 .It clip_cmd
-Clipboard executable to use with
-the program.
+Clipboard manager command
+.It debug
+Controls whether to use debug
+mode or not. Any value other
+than false is interpreted as
+true.
 .It list_cmd
-Listing executable to use
-with the program.
+Command used to print a listing
+of the password store
+.It menu_cmd
+Menu command for kanako_menu
 .El
 .Ss Encryption section
Index: trunk/kanako.mdoc
===================================================================
--- trunk/kanako.mdoc	(revision 13)
+++ trunk/kanako.mdoc	(revision 14)
@@ -1,3 +1,3 @@
-.Dd Bureaucracy 72, 3188
+.Dd Bureaucracy 73, 3188
 .Dt KANAKO 1
 .Os
@@ -5,6 +5,34 @@
 .Nm kanako
 .Nd the adaptable password manager
+.Sh SYNOPSIS
+.Nm
+.Fl c
+.Ar args
+.Nm
+.Fl e
+.Ar args
+.Nm
+.Fl l
+.Nm
+.Fl n
+.Ar args
+.Nm
+.Fl r
+.Ar args
+.Nm
+.Fl R
+.Ar args
+.Nm
+.Fl v
+.Ar args
 .Sh DESCRIPTION
-
+It is a clean rewrite of
+.Xr ayu 1
+supporting multiple backends
+and having more add-ons for
+use with it. However, it
+may be pretty unstable compared
+to said tool, but should work
+well for its purpose.
 .Sh USAGE
 .Bl -tag -width 11n -compact
@@ -27,4 +55,5 @@
 .Sh SEE ALSO
 .Xr age 1
+.Xr cream 1
 .Xr gpg 1
 .Xr kanako.conf 5
Index: trunk/mkfile
===================================================================
--- trunk/mkfile	(revision 13)
+++ trunk/mkfile	(revision 14)
@@ -5,10 +5,10 @@
 
 install-bin:
-	install -m$EXEC_MODE kanako $PREFIX/bin/kanako
+	install -Dm$EXEC_MODE kanako $PREFIX/bin/kanako
 install-examples:
-	install -m$FILE_MODE kanako.conf.example $PREFIX/share/examples/kanako/kanako.conf
+	install -Dm$FILE_MODE kanako.conf.example $PREFIX/share/examples/kanako/kanako.conf
 install-man:
-	install -m$FILE_MODE kanako.mdoc $PREFIX/share/man/man1/kanako.1
-	install -m$FILE_MODE kanako.conf.mdoc $PREFIX/share/man/man5/kanako.conf.5
+	install -Dm$FILE_MODE kanako.mdoc $PREFIX/share/man/man1/kanako.1
+	install -Dm$FILE_MODE kanako.conf.mdoc $PREFIX/share/man/man5/kanako.conf.5
 uninstall-bin:
 	rm -f $PREFIX/bin/kanako
