@@ -52,7 +52,7 @@ FOLDER_URL=$( echo ${CROMWELL_URL} | sed -e 's#ht.*://##g' )
52
52
CROMWELL_METADATA_PARAMETERS=" excludeKey=submittedFiles&expandSubWorkflows=true"
53
53
54
54
CURL_CONNECT_TIMEOUT=5
55
- CURL_MAX_TIMEOUT=10
55
+ let CURL_MAX_TIMEOUT=2 * ${CURL_CONNECT_TIMEOUT}
56
56
57
57
PING_CMD=' ping -c1 -W1 -w10'
58
58
if [[ $( uname ) == " Darwin" ]] ; then
@@ -103,7 +103,7 @@ function simpleUsage()
103
103
if [[ $# -ne 0 ]] ; then
104
104
usage | grep " ${1} " | sed -e ' s#\(.*]\).*#\1#g' -e " s#^[ \\ t]*#Usage: ${SCRIPTNAME} #g"
105
105
else
106
- echo -e " Usage: ${SCRIPTNAME} SUB-COMMAND [options]"
106
+ echo -e " Usage: ${SCRIPTNAME} [-t TIMEOUT] SUB-COMMAND [options]"
107
107
echo -e " Run and inspect workflows on a Cromwell server."
108
108
fi
109
109
}
@@ -121,8 +121,14 @@ function usage()
121
121
echo -e " example usage:"
122
122
echo -e " cromshell submit workflow.wdl inputs.json options.json dependencies.zip"
123
123
echo -e " cromshell status"
124
+ echo -e " cromshell -t 50 status"
124
125
echo -e " cromshell logs -2"
125
126
echo -e " "
127
+ echo -e " Supported Flags:"
128
+ echo -e " -t TIMEOUT Set the curl connect timeout to TIMEOUT seconds."
129
+ echo -e " Also sets the curl max timeout to 2*TIMEOUT seconds."
130
+ echo -e " TIMEOUT must be an integer."
131
+ echo -e " "
126
132
echo -e " Supported Subcommands:"
127
133
echo -e " "
128
134
echo -e " Start/Stop workflows:"
@@ -1372,6 +1378,29 @@ if ${ISINTERACTIVESHELL} ; then
1372
1378
# Check the remaining arguments for help and display it if we have to:
1373
1379
checkForComplexHelpArgument $@
1374
1380
1381
+ # Get flags:
1382
+ while getopts " :t:" opt ; do
1383
+ case ${opt} in
1384
+ t)
1385
+ # Ensure that the value given to -t is numerical:
1386
+ echo ${OPTARG} | grep -q -E ' ^[0-9]+$'
1387
+ rv=$?
1388
+ [ $rv -ne 0 ] && invalidSubCommand ' ' " flag value (${OPTARG} )" " -${opt} argument must be an integer."
1389
+
1390
+ # Set our timeouts:
1391
+ CURL_CONNECT_TIMEOUT=${OPTARG}
1392
+ let CURL_MAX_TIMEOUT=2* ${CURL_CONNECT_TIMEOUT}
1393
+ ;;
1394
+ :)
1395
+ invalidSubCommand ' ' ' flag value' " -${opt} requires an argument."
1396
+ ;;
1397
+ * )
1398
+ invalidSubCommand ' ' flag ${OPTARG}
1399
+ ;;
1400
+ esac
1401
+ done
1402
+ shift $(( OPTIND- 1 ))
1403
+
1375
1404
# Get our sub-command:
1376
1405
SUB_COMMAND=${1}
1377
1406
shift
0 commit comments