[X2Go-Commits] [x2goclient] 01/01: macbuild.sh: add usage message obtainable via -h or --help.

git-admin at x2go.org git-admin at x2go.org
Wed Feb 18 04:40:18 CET 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/cleanup
in repository x2goclient.

commit dbb1a42c541afb7206181018185c9da09da246bf
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Feb 18 04:40:00 2015 +0100

    macbuild.sh: add usage message obtainable via -h or --help.
---
 debian/changelog |    1 +
 macbuild.sh      |   22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 5ad85b3..fe627e4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -233,6 +233,7 @@ x2goclient (4.0.3.2-0x2go1) UNRELEASED; urgency=medium
     - New env var/parameter UNIVERSAL in macbuild.sh. Switches the build
       architecture to either exclusively x86_64 (UNIVERSAL=0) or both x86_64
       and x86 (UNIVERSAL=1).
+    - Add usage message to macbuild.sh obtainable via -h or --help.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Thu, 27 Nov 2014 12:01:43 +0100
 
diff --git a/macbuild.sh b/macbuild.sh
index e25caf5..5e68928 100755
--- a/macbuild.sh
+++ b/macbuild.sh
@@ -19,6 +19,28 @@ phase() {
 	echo
 }
 
+usage() {
+	exec >&2
+
+	NO_VAL="0, no, NO, No, nO, false or FALSE"
+	printf "$(basename ${0}): usage\n\n"
+	printf "Accepted environment variables:\n"
+	printf "\tSDK:\t\t\t\tsets the target SDK [string]\n\t\t\t\t\tdefault: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk\n"
+	printf "\tMACOSX_DEPLOYMENT_TARGET:\tsets the deployment target (specific OS X version to optimize/build for) [string]\n\t\t\t\t\tdefault: 10.7\n"
+	printf "\tDEBUG\t\t\t\tenables or disables debug builds [boolean]\n\t\t\t\t\tdefault: disabled\n"
+	printf "\tBUNDLE\t\t\t\tenables or disables library bundling and the creation of a .dmg installer [boolean]\n\t\t\t\t\tdefault: enabled\n"
+	printf "\tUNIVERSAL\t\t\tenables or disables x86 support. x86_64 support is always enabled [boolean]\n\t\t\t\t\tdefault: enabled\n"
+	printf "\n"
+	printf "Boolean values help:\n"
+	printf "\ta value of ${NO_VAL} will be treated as false\n"
+	printf "\tany other value will be treated as true\n"
+
+	exit 2
+}
+
+MATCH_HELP='(^((-h)|(--help))([ 	]|$))|([ 	]+((-h)|(--help))([ 	]|$))'
+[ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage
+
 NAME="x2goclient"
 
 TOP_DIR="$(dirname "$0")"

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list