From 7dd194ef30800534bb97c1e4a4cccbf93c59d5e9 Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Mon, 16 Jan 2017 11:14:39 +0100 Subject: [PATCH] [FEATURE] Bash script: Enhance help and add version Enhance the help and show all available options in a common structure. Move description of available options to one place. Also add the version of the Jirafeau version which generated the bash script. This way a user may find out about changes (because his script was generated with Jirafeau 1.1.2, but the current version on the server may be 3.2.5 already). --- script.php | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/script.php b/script.php index c5adf95..3905d2f 100644 --- a/script.php +++ b/script.php @@ -243,16 +243,15 @@ elseif (isset ($_GET['lang'])) ?> #!/bin/bash -# This script has been auto-generated by Jirafeau but you can still edit -# options below. +# This script has been auto-generated by Jirafeau but you can still edit options below. -# Config -proxy='' # ex: proxy='proxysever.test.com:3128' or set JIRAFEAU_PROXY global variable -url='' # or set JIRAFEAU_URL ex: url='http://mysite/jirafeau/script.php' -time='' # minute, hour, day, week, month, quarted, year or none. Or set JIRAFEAU_TIME. -one_time='' # ex: one_time="1" or set JIRAFEAU_ONE_TIME. -curl='' # curl path to download or set JIRAFEAU_CURL_PATH. -# End of config +# Config begin +proxy='' # Or set JIRAFEAU_PROXY. +url='' # Or set JIRAFEAU_URL. +time='' # Or set JIRAFEAU_TIME. +one_time='' # Or set JIRAFEAU_ONE_TIME. +curl='' # Or set JIRAFEAU_CURL_PATH. +# Config end if [ -n "$JIRAFEAU_PROXY" ]; then proxy="$JIRAFEAU_PROXY" @@ -292,17 +291,22 @@ if [ -z "$curl" ]; then fi if [ -z "$2" ]; then - echo "man:" - echo " $0 send PATH [PASSWORD]" + echo "Jirafeau Bash Script " + echo "--------------------------" + echo "Usage:" + echo " $0 OPTIONS" + echo + echo "Options:" + echo " $0 send FILE [PASSWORD]" echo " $0 get URL [PASSWORD]" echo " $0 delete URL" - echo "" + echo echo "Global variables to export:" - echo " JIRAFEAU_PROXY : example: proxysever.test.com:3128" - echo " JIRAFEAU_URL : example: http://mysite/jirafeau/script.php" - echo " JIRAFEAU_TIME : minute, hour, day, week, quarter, year, month or none" - echo " JIRAFEAU_ONE_TIME : set anything or set empty" - echo " JIRAFEAU_CURL : path to your curl binary" + echo " JIRAFEAU_PROXY: Domain and port of proxy server, eg. »proxysever.example.com:3128«" + echo " JIRAFEAU_URL : URI to Jirafeau installation and API page with trailing slash, eg. »https://example.com/jirafeau/script.php«" + echo " JIRAFEAU_TIME : expiration time, eg. »minute«, »hour«, »day«, »week«, »month«, »quarter«, »year« or »none«" + echo " JIRAFEAU_ONE_TIME : self-destroy after first download, eg. »1« to enable or »« (empty) to disable" + echo " JIRAFEAU_CURL : alternative path to curl binary" exit 0 fi -- 2.34.1