X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fwhatnow2.sh;h=7ddebeaa92e9f102d4b90ca9f4edf6eda674f344;hp=a4be1a9277f3668b5d3f6f0fa31209da3c4d615a;hb=88b2142594d5ea1e8385dae5eca81eed1018c555;hpb=501f523802eeaed49dc095c9577a9e5f20447a6d diff --git a/uip/whatnow2.sh b/uip/whatnow2.sh index a4be1a9..7ddebea 100755 --- a/uip/whatnow2.sh +++ b/uip/whatnow2.sh @@ -19,7 +19,7 @@ printhelp() version() { - if [ $# -eq 0 ] + if [ $1 -eq 0 ] then echo "$0 has no own version number, thus this instead:" folder -Version @@ -38,7 +38,7 @@ usage() exit 0 fi printhelp 1>&2 - exit $1 + exit 1 } get_editor() @@ -61,21 +61,6 @@ get_editor() return fi mheditor=`mhparam 'Editor'` - if [ -n "$mheditor" ] - then - return - fi - if [ -n "$VISUAL" ] - then - mheditor=$VISUAL - return - fi - if [ -n "$EDITOR" ] - then - mheditor=$EDITOR - return - fi - mheditor=vi } get_showproc() @@ -163,7 +148,7 @@ list() exec $mhshowproc -file $mhdraft } -send() +sendfunktion() { export mhaltmsg=`anno -list -component 'mhaltmsg' $mhmetafile` export mhdist=`anno -list -component 'mhdist' $mhmetafile` @@ -171,13 +156,16 @@ send() export mhfolder=`anno -list -component 'mhfolder' $mhmetafile` export mhmessages=`anno -list -component 'mhmessages' $mhmetafile` export mhannotate=`anno -list -component 'mhannotate' $mhmetafile` + send "$@" $mhdraft || exit $? rm -f $mhmetafile - exec send "$@" $mhdraft + exit 0 } delete() { - rmm +draft c + folder -push $draftfolder >/dev/null 2>&1 + rmm $draftfolder c + folder -pop >/dev/null 2>&1 rm $mhmetafile } @@ -226,7 +214,7 @@ display() { mhaltmsg=`anno -list -component 'mhaltmsg' $mhmetafile` get_showproc - if [ -n "$mhaltmsg" ] + if [ -z "$mhaltmsg" ] then echo "no altmsg" 1>&2 exit 1 @@ -243,11 +231,8 @@ fi command=$1 shift -draftfolder=`mhparam Draft-Folder` -if [ -z "$dratffolder" ] -then - draftfolder="+drafts" -fi +draftfolder=`mhparam draftfolder` + mhdraft=`mhpath $draftfolder c 2>/dev/null` if [ -z "$mhdraft" ] then @@ -269,44 +254,47 @@ touch $mhmetafile case $command in -e*) +e|ed|edi|edit) edit "$@" ;; -l*) +l|li|lis|list) [ $# -eq 0 ] || usage 1 list ;; -s*) - send "$@" +s|se|sen|send) + sendfunktion "$@" ;; -del*) +del|dele|delet|delete) [ $# -eq 0 ] || usage 1 delete ;; -di*) +di|dis|disp|displ|displa|display) [ $# -eq 0 ] || usage 1 display ;; -at*) +at|att|atta|attac|attach) attach "$@" ;; -al*) +al|ali|alis|alist) [ $# -eq 0 ] || usage 1 alist ;; -det*) +det|deta|detac|detach) detach "$@" ;; -r*) - refile -nolink -file $mhdraft "$@" +r|re|ref|refi|refil|refile) + refile -file $mhdraft "$@" ;; -w*) +w|wh|who|whom) whom "$@" $mhdraft ;; --h*) +-h|-he|-hel|-help) usage $# ;; --V*) +-V|-Ve|-Ver|-Vers|-Versi|-Versio|-Version) version $# ;; +*) + usage 1 + ;; esac