X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t;h=12df2a0a35e61e56eb89c87625b48bfd1703384a;hb=32b898705759fb9a0aa96ebf1413ec4f5c899a14;hp=dbfcc3aee597e35a438f409fef626e3ed744be7c;hpb=6190dc59d0d028b5defb17dcd773ace0ab76b5ae;p=t.git diff --git a/t b/t index dbfcc3a..12df2a0 100755 --- a/t +++ b/t @@ -1,6 +1,6 @@ #!/bin/sh -e # t -- simple notes manager -# Copyright (C) 2013-2016 Sergey Matveev +# Copyright (C) 2013-2020 Sergey Matveev # Invoke the script without any arguments to briefly print all notes. # Otherwise you can specify the following ones: # a -- add new note (either starts an editor if not arguments are specified, @@ -34,7 +34,7 @@ fi case "$1" in a) shift - note=$NOTES_DIR/$(date '+%s') + note=$NOTES_DIR/$(date "+%Y%m%d-%H%M%S") [ $# -gt 0 ] && echo "$@" > $note || $EDITOR $note ;; d) @@ -44,7 +44,8 @@ m) $EDITOR $(get_note $2) ;; *) - cat $(get_note $1) + note=$(get_note $1) + [ -e "$note" ] && cat $note || exit 1 ;; esac purge