Add modules options in short help

This commit is contained in:
Antonin Décimo
2015-06-26 17:32:12 +02:00
parent b968ddbc82
commit 0e9c8b624d
2 changed files with 9 additions and 2 deletions

View File

@@ -19,9 +19,12 @@ love-release: clean
ll="$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -re "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//" -e "s/,/,$${s}/g")"; \ ll="$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -re "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//" -e "s/,/,$${s}/g")"; \
if [[ -n $$ll ]]; then l="$${l},$${s}$${ll}"; fi; \ if [[ -n $$ll ]]; then l="$${l},$${s}$${ll}"; fi; \
long="$${l},$${long}"; \ long="$${l},$${long}"; \
if [[ -n $$shelp ]]; then shelp="$$shelp\n"; fi; \
shelp="$$shelp -$$(grep "init_module" $$file | sed -e 's/init_module //' -e 's/" "/\t/g' -e 's/"//g' | awk -F "\t" '{print($$3," ",$$1)}')"; \
done; \ done; \
sed -re "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \ sed -re "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \
-e 's/INSTALLED=false/INSTALLED=true/' \ -e 's/INSTALLED=false/INSTALLED=true/' \
-e "/^EndOfSHelp/ i\\$$shelp" \
-e 's/SCRIPTS_DIR="scripts"/SCRIPTS_DIR="$(SED_INSTALL_DIR)\/scripts"/' love-release.sh > '$(BUILD_DIR)/love-release'; \ -e 's/SCRIPTS_DIR="scripts"/SCRIPTS_DIR="$(SED_INSTALL_DIR)\/scripts"/' love-release.sh > '$(BUILD_DIR)/love-release'; \
comp="$$(if [[ -n $$long ]]; then echo --$$long | tr -d ':' | sed -e 's/,$$//' -e 's/,/ --/g'; fi)$$(if [[ -n $$short ]]; then echo $$short | sed -r 's/(.)/ -\1/g'; fi) "; \ comp="$$(if [[ -n $$long ]]; then echo --$$long | tr -d ':' | sed -e 's/,$$//' -e 's/,/ --/g'; fi)$$(if [[ -n $$short ]]; then echo $$short | sed -r 's/(.)/ -\1/g'; fi) "; \
sed -re "s/opts=\"(.*)/opts=\"$$comp\1/" completion.sh > '$(BUILD_DIR)/completion.sh' sed -re "s/opts=\"(.*)/opts=\"$$comp\1/" completion.sh > '$(BUILD_DIR)/completion.sh'
@@ -49,9 +52,11 @@ embedded: clean
ll="$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -re "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//" -e "s/,/,$${s}/g")"; \ ll="$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -re "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//" -e "s/,/,$${s}/g")"; \
if [[ -n $$ll ]]; then l="$${l},$${s}$${ll}"; fi; \ if [[ -n $$ll ]]; then l="$${l},$${s}$${ll}"; fi; \
long="$${l},$${long}"; \ long="$${l},$${long}"; \
shelp="$$shelp -$$(grep "init_module" $$file | sed -e 's/init_module //' -e 's/" "/\t/g' -e 's/"//g' | awk -F "\t" '{print($$3," ",$$1)}')"; \
done; \ done; \
sed -re "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \ sed -re "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \
-e 's/EMBEDDED=false/EMBEDDED=true/' \ -e 's/EMBEDDED=false/EMBEDDED=true/' \
-e "/^EndOfSHelp/ i\\$$shelp" \
-e '/include_scripts_here$$/r $(BUILD_DIR)/tmp' love-release.sh > '$(BUILD_DIR)/love-release.sh' -e '/include_scripts_here$$/r $(BUILD_DIR)/tmp' love-release.sh > '$(BUILD_DIR)/love-release.sh'
chmod 0775 '$(BUILD_DIR)/love-release.sh' chmod 0775 '$(BUILD_DIR)/love-release.sh'
rm -rf '$(BUILD_DIR)/tmp' rm -rf '$(BUILD_DIR)/tmp'

View File

@@ -254,14 +254,16 @@ default_module () {
# Print short help # Print short help
short_help () { short_help () {
cat <<EOF cat <<EndOfSHelp
Usage: love-release.sh [options...] [files...] Usage: love-release.sh [options...] [files...]
Options: Options:
-h Print short help -h Print short help
-t <title> Set the project's title -t <title> Set the project's title
-r <release> Set the release directory -r <release> Set the release directory
-v <version> Set the LÖVE version -v <version> Set the LÖVE version
EOF Modules:
-L LÖVE
EndOfSHelp
} }
dump_var () { dump_var () {