projects
/
xremote.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
917a82f
)
Added some error messages.
author
Francois Fleuret
<francois.fleuret@idiap.ch>
Thu, 11 Oct 2018 10:31:38 +0000
(12:31 +0200)
committer
Francois Fleuret
<francois.fleuret@idiap.ch>
Thu, 11 Oct 2018 10:31:38 +0000
(12:31 +0200)
xremote.sh
patch
|
blob
|
history
diff --git
a/xremote.sh
b/xremote.sh
index
5536d01
..
33396bc
100755
(executable)
--- a/
xremote.sh
+++ b/
xremote.sh
@@
-35,7
+35,7
@@
function check_remote_is_defined () {
function help () {
cat <<EOF
function help () {
cat <<EOF
-xremote.sh [-h <remote_host>] [-i <remote_dir>] <script> [script arguments]
+xremote.sh [-
-help] [-
h <remote_host>] [-i <remote_dir>] <script> [script arguments]
This script takes a script as argument and executes it remotely in a
temporary directory on a ssh-accessible server.
This script takes a script as argument and executes it remotely in a
temporary directory on a ssh-accessible server.
@@
-92,17
+92,24
@@
do
-h)
shift
ARG_HOST="$1"
-h)
shift
ARG_HOST="$1"
+ [[ ${ARG_HOST} ]] || (echo "xremote: Hostname missing." && exit 1)
echo "xremote: remote forced to ${ARG_HOST}"
;;
-i)
shift
ARG_DIR="$1"
echo "xremote: remote forced to ${ARG_HOST}"
;;
-i)
shift
ARG_DIR="$1"
+ [[ ${ARG_DIR} ]] || (echo "xremote: Directory missing." && exit 1)
echo "xremote: remote dir set to ${ARG_DIR}"
;;
echo "xremote: remote dir set to ${ARG_DIR}"
;;
+ --help)
+ help
+ exit 0
+ ;;
+
*)
*)
- echo "Unknown option $1"
+ echo "
xremote:
Unknown option $1"
exit 1
;;
esac
exit 1
;;
esac
@@
-111,7
+118,9
@@
done
######################################################################
######################################################################
-[[ -a "$1" ]] || (help && echo >&2 "Cannot find $1" && exit 1)
+[[ "$1" ]] || (echo "xremote: Script name missing" && exit 1)
+
+[[ -a "$1" ]] || (help && echo >&2 "xremote: Cannot find script \`$1'" && exit 1)
cd "$(dirname "$1")"
cd "$(dirname "$1")"