@@ -98,6 +98,7 @@ get_gpg_keyid () {
98
98
echo valid gpg key $newkeyid
99
99
else
100
100
echo No key supplied:
101
+ exit 1
101
102
fi
102
103
103
104
}
@@ -142,7 +143,8 @@ note_add () {
142
143
notefile=" ${USE_POINTER} /` echo ${filen} | tr ' ' ' _' ` "
143
144
144
145
if [ -f " $notefile .gpg" ] ; then
145
- echo File exists ... cannot create
146
+ echo File exists ... cannot create. Try ' notes edit' instead.
147
+ exit 1
146
148
else
147
149
get_recipient
148
150
@@ -185,6 +187,7 @@ note_view () {
185
187
gpg -d " ${notefile} .gpg"
186
188
else
187
189
echo Note file does not exist
190
+ exit 1
188
191
fi
189
192
}
190
193
@@ -195,9 +198,6 @@ note_edit () {
195
198
196
199
get_recipient
197
200
198
- echo $notefile
199
- echo $decrypted
200
-
201
201
if [ -f " $notefile " ]; then
202
202
gpg -d -o " ${decrypted} " " ${notefile} "
203
203
${EDITOR} " ${decrypted} "
@@ -210,6 +210,7 @@ note_edit () {
210
210
rm ${decrypted}
211
211
else
212
212
echo Note file does not exist
213
+ exit 1
213
214
fi
214
215
}
215
216
@@ -263,6 +264,7 @@ note_rename () {
263
264
$MVCP " $notefile " " $newnotefile "
264
265
else
265
266
echo Note $notefile does not exist, aborting...
267
+ exit 1
266
268
fi
267
269
}
268
270
@@ -296,6 +298,7 @@ notebook_delete () {
296
298
rmdir " $notebook "
297
299
else
298
300
echo Deleting files aborted ... aborting deleting notebook $notebook
301
+ exit 1
299
302
fi
300
303
fi
301
304
}
@@ -323,6 +326,7 @@ notebook_rename () {
323
326
$MVCP " $notebook " " $newnotebook "
324
327
else
325
328
echo Note $notebook does not exist, aborting...
329
+ exit 1
326
330
fi
327
331
}
328
332
@@ -398,7 +402,7 @@ cmd_config () {
398
402
}
399
403
400
404
cmd_tree () {
401
- tree ${NOTESDIR} | ${PAGER}
405
+ tree ${NOTESDIR}
402
406
}
403
407
404
408
cmd_view () {
@@ -491,11 +495,11 @@ cmd_default () {
491
495
exit 0
492
496
fi
493
497
if [ -d " $notebook " ] ; then
494
- echo target notebook exists
495
498
unlink " $DEFAULT_POINTER "
496
499
ln -sf " $nb " " $DEFAULT_POINTER "
497
500
else
498
501
echo Cannot set default notebook to $notebook as it does not exist
502
+ exit 1
499
503
fi
500
504
}
501
505
@@ -512,11 +516,11 @@ cmd_use () {
512
516
exit 0
513
517
fi
514
518
if [ -d " $notebook " ] ; then
515
- echo target notebook exists
516
519
unlink " $USE_POINTER "
517
520
ln -sf " $nb " " $USE_POINTER "
518
521
else
519
522
echo Cannot use $notebook as $nb does not exist
523
+ exit 1
520
524
fi
521
525
}
522
526
0 commit comments