commit 4dd71e03a68c70999a720cf31faacc9b566ed5ad
parent ef2a3b4b4cd623735ddd97c5c5387c64bc71faa9
Author: Jaromil <jaromil@dyne.org>
Date: Fri, 15 Jun 2012 18:46:56 +0200
fixed account selection and default
Diffstat:
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/jaro b/src/jaro
@@ -113,7 +113,7 @@ ${=mkdir} $WORKDIR
# make sure the directory is private
chmod 700 $WORKDIR
-PATH=$WORKDIR/bin:/bin:/usr/bin:/usr/local/bin:/opt/local/bin
+PATH=$WORKDIR/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/local/bin
# temporary directory
TMPDIR=$WORKDIR/tmp
@@ -469,25 +469,25 @@ maildirmake() {
# -a defines which account name other than 'default'
read_account() {
typeset -al all
-
+ type=$1
# find the file
func "read_account looking for \"$account\""
- for a in `find $WORKDIR/Accounts -name "$account*"`; do
+ for a in `find $WORKDIR/Accounts -name "$type.$account*"`; do
func "found account: $a"
all+=($a)
done
if [ ${#all} = 0 ]; then
error "No $type account found: $account"
- error "Refine your argument using '-a type.account'"
- error "For instance adding to the commandline: -a imap.default"
- error "Available accounts (excluding symbolic links):"
- for a in `find $WORKDIR/Accounts -type f | grep -v README`; do
- act -n "`basename $a` :: "
+ act "Refine your argument using '-a type.account'"
+ act "For instance adding to the commandline: -a imap.default"
+ act "Available accounts (excluding symbolic links, omit final .txt):"
+ for a in `find $WORKDIR/Accounts -type f | grep -v README | sed 's/.txt//'`; do
+ act -n "`basename $a`\t :: "
awk '
/^name/ { for(i=2;i<=NF;i++) printf "%s ", $i }
/^email/ { printf "<%s>", $2 }
/^host/ { printf " on %s", $2 }
-{next}' $a
+{next}' $a.txt
echo " (`basename $a | cut -d. -f1`)"
done
return 1