]> pd.if.org Git - zpackage/blobdiff - zpm-note
initial implementation of zpm-bug
[zpackage] / zpm-note
index e9115440fd74d7bc1791cdca78c1ee560734cbe2..72f5f401a9d8c2c514a7868c98af78dabcf74580 100755 (executable)
--- a/zpm-note
+++ b/zpm-note
@@ -37,7 +37,7 @@ shift
 findnote() {
        file=$(find $SPOOL -type f -name "$1")
        if [ -z "$file" ] ; then
-               [ -z "$quiet" ] || printf "no such note $1\n"
+               [ -z "$quiet" ] || printf "no such note $1\n" 1>&2
                exit 1
        fi
        echo $file
@@ -46,13 +46,17 @@ findnote() {
 findopen() {
        file=$(find $SPOOL/open -type f -name "$1")
        if [ -z "$file" ] ; then
-               [ -z "$quiet" ] || printf "no such open note $1\n"
+               [ -z "$quiet" ] || printf "no such open note $1\n" 1>&2
                exit 1
        fi
        echo $file
 }
 
 case $cmd in
+       category)
+               notefile=$(findnote $1)
+               printf "%s\n" $(basename $(dirname $notefile))
+               ;;
        list)
                case $1 in
                        -a) find $SPOOL/ack -type f -printf '%P\n' | sort -n