@@ -98,6 +98,7 @@ get_gpg_keyid () {
9898 echo valid gpg key $newkeyid
9999 else
100100 echo No key supplied:
101+ exit 1
101102 fi
102103
103104}
@@ -142,7 +143,8 @@ note_add () {
142143 notefile=" ${USE_POINTER} /` echo ${filen} | tr ' ' ' _' ` "
143144
144145 if [ -f " $notefile .gpg" ] ; then
145- echo File exists ... cannot create
146+ echo File exists ... cannot create. Try ' notes edit' instead.
147+ exit 1
146148 else
147149 get_recipient
148150
@@ -185,6 +187,7 @@ note_view () {
185187 gpg -d " ${notefile} .gpg"
186188 else
187189 echo Note file does not exist
190+ exit 1
188191 fi
189192}
190193
@@ -195,9 +198,6 @@ note_edit () {
195198
196199 get_recipient
197200
198- echo $notefile
199- echo $decrypted
200-
201201 if [ -f " $notefile " ]; then
202202 gpg -d -o " ${decrypted} " " ${notefile} "
203203 ${EDITOR} " ${decrypted} "
@@ -210,6 +210,7 @@ note_edit () {
210210 rm ${decrypted}
211211 else
212212 echo Note file does not exist
213+ exit 1
213214 fi
214215}
215216
@@ -263,6 +264,7 @@ note_rename () {
263264 $MVCP " $notefile " " $newnotefile "
264265 else
265266 echo Note $notefile does not exist, aborting...
267+ exit 1
266268 fi
267269}
268270
@@ -296,6 +298,7 @@ notebook_delete () {
296298 rmdir " $notebook "
297299 else
298300 echo Deleting files aborted ... aborting deleting notebook $notebook
301+ exit 1
299302 fi
300303 fi
301304}
@@ -323,6 +326,7 @@ notebook_rename () {
323326 $MVCP " $notebook " " $newnotebook "
324327 else
325328 echo Note $notebook does not exist, aborting...
329+ exit 1
326330 fi
327331}
328332
@@ -398,7 +402,7 @@ cmd_config () {
398402}
399403
400404cmd_tree () {
401- tree ${NOTESDIR} | ${PAGER}
405+ tree ${NOTESDIR}
402406}
403407
404408cmd_view () {
@@ -491,11 +495,11 @@ cmd_default () {
491495 exit 0
492496 fi
493497 if [ -d " $notebook " ] ; then
494- echo target notebook exists
495498 unlink " $DEFAULT_POINTER "
496499 ln -sf " $nb " " $DEFAULT_POINTER "
497500 else
498501 echo Cannot set default notebook to $notebook as it does not exist
502+ exit 1
499503 fi
500504}
501505
@@ -512,11 +516,11 @@ cmd_use () {
512516 exit 0
513517 fi
514518 if [ -d " $notebook " ] ; then
515- echo target notebook exists
516519 unlink " $USE_POINTER "
517520 ln -sf " $nb " " $USE_POINTER "
518521 else
519522 echo Cannot use $notebook as $nb does not exist
523+ exit 1
520524 fi
521525}
522526
0 commit comments