simplified subdir parameter passing

This commit is contained in:
mtekman 2017-09-10 22:14:27 +02:00
commit 6f3dce6972

View file

@ -61,11 +61,15 @@ or run the install script."
local file=$1 local file=$1
local command=$2 local command=$2
# Is file an existing subfolder?
local sub_dir=""
if [ -d ${org_dir}/$file ]; then
sub_dir=$file
file=""
fi
case $file in case $file in
"");& "") # applies to subdirs too
--subdir=*)
local sub_dir=`echo $file | sed 's|--subdir=||'`
local title="You have the following org-mode notes:" local title="You have the following org-mode notes:"
if [ "$sub_dir" != "" ]; then if [ "$sub_dir" != "" ]; then
title=`echo $title | sed "s|:| [${sub_dir}]:|"` title=`echo $title | sed "s|:| [${sub_dir}]:|"`
@ -82,9 +86,9 @@ or run the install script."
-h);& -h);&
--help) --help)
echo " echo "
`basename $0` [--help] [--sync] [--subdir=<dest>] <filename [--delete] [--move=<dest>] [--encrypt] [--decrypt]> `basename $0` [--help] [--sync] [sub-folder] <filename [--delete] [--move=<dest>] [--encrypt] [--decrypt]>
Generates an org-notes file in a folder location set in the $org_loc file Generates an org-notes file in a folder location set in the $org_loc file, or a given sub-folder
"; ";
return -1; return -1;
;; ;;