######################################################################
-[[ -a "$1" ]] || (help && exit 1)
+[[ -a "$1" ]] || (help && echo >&2 "Cannot find $1" && exit 1)
+
+cd "$(dirname "$1")"
main="$(basename "$1")"
main_config="${main}.xremote"
-if [[ ! -f "${main}.xremote" ]]
+if [[ -f "${main_config}" ]]
then
+ echo "xremote: found ${main_config}"
+else
main_config="${main}"
fi
-cd "$(dirname "$1")"
-
shift
trap cleanup_remote_tmp EXIT
######################################################################
# I find this slightly ugly ...
+
for s in "$@"
do
quoted_args="${quoted_args} \"${s}\""
;;
esac
fi
+
done < "${main_config}"
set +f