diff --git a/Makefile b/Makefile index 491a074..6ac9075 100644 --- a/Makefile +++ b/Makefile @@ -14,10 +14,10 @@ love-release: deps clean mkdir -p '$(BUILD_DIR)' longopt=$$(grep -m1 "LONG_OPTIONS" love-release.sh | sed -E 's/.*LONG_OPTIONS="(.*)"/\1/'); \ for file in scripts/*.sh; do \ - s="$$(grep -E -m1 "^OPTIONS" "$$file" | sed -E "s/OPTIONS=(['\"]?)(.*)\1/\2/")"; \ + s="$$(grep -E -m1 "^MOD_OPTIONS" "$$file" | sed -E "s/OPTIONS=(['\"]?)(.*)\1/\2/")"; \ short="$${short}$${s}"; \ s="$${s:0:1}"; \ - ll=$$(grep -E -m1 "^LONG_OPTIONS" "$$file" | sed -E "s/LONG_OPTIONS=(['\"]?)(.*)\1/\2/"); \ + ll=$$(grep -E -m1 "^MOD_LONG_OPTIONS" "$$file" | sed -E "s/LONG_OPTIONS=(['\"]?)(.*)\1/\2/"); \ long="$${long},$${s}$${longopt//,/,$$s}"; \ if [[ -n $$ll ]]; then long="$${long},$${s}$${ll//,/,$$s}"; fi; \ shelp="$$shelp\\n\\ -$$(grep "init_module" $$file | sed -Ee 's/init_module //' -e 's/" "/ /g' -e "s/\"//g" | awk -F "\t" '{print($$3," ",$$1)}')\\"; \ @@ -47,10 +47,10 @@ embedded: clean module="$$(basename -s '.sh' "$$file")"; \ content='(source <(cat <<\EndOfModule'$$'\n'"$$(cat $$file)"$$'\n''EndOfModule'$$'\n''))'$$'\n''default_module'$$'\n\n'; \ echo "$$content" >> "$(BUILD_DIR)/tmp"; \ - s="$$(grep -E -m1 "^OPTIONS" "$$file" | sed -E "s/OPTIONS=(['\"]?)(.*)\1/\2/")"; \ + s="$$(grep -E -m1 "^MOD_OPTIONS" "$$file" | sed -E "s/OPTIONS=(['\"]?)(.*)\1/\2/")"; \ short="$${short}$${s}"; \ s="$${s:0:1}"; \ - ll=$$(grep -E -m1 "^LONG_OPTIONS" "$$file" | sed -E "s/LONG_OPTIONS=(['\"]?)(.*)\1/\2/"); \ + ll=$$(grep -E -m1 "^MOD_LONG_OPTIONS" "$$file" | sed -E "s/LONG_OPTIONS=(['\"]?)(.*)\1/\2/"); \ long="$${long},$${s}$${longopt//,/,$$s}"; \ if [[ -n $$ll ]]; then long="$${long},$${s}$${ll//,/,$$s}"; fi; \ shelp="$$shelp\\n\\ -$$(grep "init_module" $$file | sed -Ee 's/init_module //' -e 's/" "/ /g' -e "s/\"//g" | awk -F "\t" '{print($$3," ",$$1)}')\\"; \ @@ -106,4 +106,3 @@ remove: clean: rm -rf '$(BUILD_DIR)' - diff --git a/modules.md b/modules.md index ab84b2d..8865e6c 100644 --- a/modules.md +++ b/modules.md @@ -51,10 +51,10 @@ For example, we could have `init_module "Android" "android" "A"`. Declare the additional options your script will be using. Beware ! They are parsed by sed, so let them be simple strings at the beginning of the line. -Love-release uses GNU getopt. Short options are made of one character. Add them in the `$OPTIONS` variable. Long options can be added in the `$LONG_OPTIONS` variable, separated by a comma. Each option may be followed by one colon to indicate it has a required argument, and by two colons to indicate it has an optional argument. +Love-release uses GNU getopt. Short options are made of one character. Add them in the `$MOD_OPTIONS` variable. Long options can be added in the `$MOD_LONG_OPTIONS` variable, separated by a comma. Each option may be followed by one colon to indicate it has a required argument, and by two colons to indicate it has an optional argument. ```bash -OPTIONS="A" -LONG_OPTIONS="activity:,update" +MOD_OPTIONS="A" +MOD_LONG_OPTIONS="activity:,update" ``` ## Setup diff --git a/scripts/android.sh b/scripts/android.sh index b776386..ecdf434 100644 --- a/scripts/android.sh +++ b/scripts/android.sh @@ -1,7 +1,7 @@ # Android debug package init_module "Android" "android" "A" -OPTIONS="A" -LONG_OPTIONS="activity:,update" +MOD_OPTIONS="A" +MOD_LONG_OPTIONS="activity:,update" IDENTITY=$(echo $TITLE | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]') @@ -153,4 +153,3 @@ rm -rf src/com bin gen exit_module - diff --git a/scripts/debian.sh b/scripts/debian.sh index 6c8cc80..eac8f87 100644 --- a/scripts/debian.sh +++ b/scripts/debian.sh @@ -1,7 +1,7 @@ # Debian package init_module "Debian" "debian" "D" -OPTIONS="D" -LONG_OPTIONS="" +MOD_OPTIONS="D" +MOD_LONG_OPTIONS="" IDENTITY=$(echo $TITLE | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]') @@ -101,4 +101,3 @@ rm -rf "$TEMP" exit_module - diff --git a/scripts/macosx.sh b/scripts/macosx.sh index 87d6851..c31f59b 100644 --- a/scripts/macosx.sh +++ b/scripts/macosx.sh @@ -1,7 +1,7 @@ # Mac OS X init_module "Mac OS X" "osx" "M" -OPTIONS="M" -LONG_OPTIONS="" +MOD_OPTIONS="M" +MOD_LONG_OPTIONS="" IDENTITY=$(echo $TITLE | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]') @@ -97,4 +97,3 @@ fi exit_module - diff --git a/scripts/windows.sh b/scripts/windows.sh index 5d01056..844650d 100644 --- a/scripts/windows.sh +++ b/scripts/windows.sh @@ -1,7 +1,7 @@ # Windows init_module "Windows" "windows" "W" -OPTIONS="W::" -LONG_OPTIONS="appid:,installer" +MOD_OPTIONS="W::" +MOD_LONG_OPTIONS="appid:,installer" if [[ -z $IDENTITY ]]; then IDENTITY=$(echo $IDENTITY | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]') @@ -234,4 +234,3 @@ fi exit_module -