diff --git a/win/bundle.common b/win/bundle.common index 35d1df0..97c18c8 100644 --- a/win/bundle.common +++ b/win/bundle.common @@ -25,6 +25,37 @@ # http://drup.org/gtk-warning-error-loading-icon-couldnt-recognize-image-file-format # +# Check command-line arguments +argument() { + + local cmdline + for cmdline in ${BASH_ARGV[*]} + do + if [ "$(echo ${cmdline} | sed "s@^--@@g" | sed "s@^-@@g" | cut -d= -f1)" == "${1}" ]; then + local value + value="$(echo ${cmdline} | cut -d= -f2)" + if [ -z "${value}" ]; then + echo "1" + else + echo "${value}" + fi + return 0 + fi + done + echo "" + return 2 +} + +argument "help" > /dev/null +if [ "$?" == "0" ]; then + echo "Use ${0} options" + echo "" + echo " --help Help options (this screen)" + echo " --zip Build zipfile" + echo " --nsi Build nsi installer" + echo " --upload Upload bundle to github" +fi + # Setup default paths srcdir="$(dirname $(dirname $(readlink -f "${0}")))" cd ${srcdir} @@ -97,6 +128,12 @@ fi export LANG=C prepare() { + + argument "help" > /dev/null + if [ "$?" == "0" ]; then + exit 0 + fi + rm -fr "${buildroot}" mkdir -p "${buildroot}" } @@ -350,26 +387,6 @@ install_loaders() { } -argument() { - - local cmdline - for cmdline in ${BASH_ARGV[*]} - do - if [ "$(echo ${cmdline} | sed "s@^--@@g" | sed "s@^-@@g" | cut -d= -f1)" == "${1}" ]; then - local value - value="$(echo ${cmdline} | cut -d= -f2)" - if [ -z "${value}" ]; then - echo "1" - else - echo "${value}" - fi - return 0 - fi - done - echo "" - return 2 -} - make_zip() { cd ${buildroot}${MINGW_PREFIX} diff --git a/win/bundle.cross b/win/bundle.cross index 3d33d1b..bacb829 100755 --- a/win/bundle.cross +++ b/win/bundle.cross @@ -33,6 +33,12 @@ REPOSITORY_NAME="pw3270" # Load bundle functions . "$(dirname $(readlink -f "${0}"))/bundle.common" +argument "help" > /dev/null +if [ "$?" == "0" ]; then + echo " --install-requires Install required packages" + echo " --build Build application from source" +fi + prepare # List of pre-req packages -- libgit2 0.21.2