summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2017-03-19 22:50:08 (GMT)
committer Jaromil <jaromil@dyne.org>2017-03-19 22:50:08 (GMT)
commit76f64f5c0748d46c6243fdf00f696395c9993f90 (patch)
treee23db833fdc99bbf6eaeddc80925a57d53cbd3c5
parentda38892d2abe5174b25e004af02699f7f0dd9aef (diff)
various minor fixes
program name shown in logs, mutt invocation from main() and regex match on isemail()
-rwxr-xr-xsrc/jaro14
-rwxr-xr-xsrc/zlibs/helpers2
2 files changed, 6 insertions, 10 deletions
diff --git a/src/jaro b/src/jaro
index dffa46b..a7fc7b0 100755
--- a/src/jaro
+++ b/src/jaro
@@ -22,6 +22,7 @@
# this source code; if not, write to:
# Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+PROGRAM=jaro-mail
VERSION=4.3-dev
DATE=Mar/2017
JAROMAILEXEC=$0
@@ -121,12 +122,7 @@ zmodload zsh/sched
# SQL command
SQL=sqlite3
-
-PARAM=()
-typeset -A global_opts
-typeset -A opts
-
-vars+=(global_quit)
+vars+=(PROGRAM global_quit)
global_quit=0
# global variable for account selection
@@ -867,9 +863,9 @@ EOF
subcommand=${subcommand[(ws@:@)2]}
func "subcommand: $subcommand"
if isemail "$subcommand"; then
- notice "Composing message to: ${@}"
+ notice "Composing message to: $*"
# its an email, TODO see if we have it in our addressbook
- x_mutt ${=@}
+ x_mutt $*
exitcode=0
# or a directory of file
elif maildircheck "$subcommand"; then
@@ -881,7 +877,7 @@ EOF
exitcode=$?
elif [[ -f "$subcommand" ]]; then
# is it a regular file? then ;attach it
- x_mutt -a ${=@}
+ x_mutt -a $*
exitcode=0
else
# just open; mutt on first unread folder
diff --git a/src/zlibs/helpers b/src/zlibs/helpers
index fb8305b..92c6bca 100755
--- a/src/zlibs/helpers
+++ b/src/zlibs/helpers
@@ -49,7 +49,7 @@ awk '{ for (i=1;i<=NF;i++)
# zmodload zsh/regex
isemail() {
- [[ "$1" -regex-match "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" ]] && return 0
+ [[ $1 -regex-match '\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b' ]] && return 0
return 1
}