Update bash completion

This commit is contained in:
Antonin Décimo
2015-06-24 00:23:03 +02:00
parent 979ddf5719
commit 2dc8fd07d5
2 changed files with 6 additions and 8 deletions

View File

@@ -22,7 +22,9 @@ love-release: clean
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 '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) "; \
sed -re "s/opts=\"(.*)/opts=\"$$comp\1/" completion.sh > '$(BUILD_DIR)/completion.sh'
cp love-release.1 '$(BUILD_DIR)/love-release.1' cp love-release.1 '$(BUILD_DIR)/love-release.1'
gzip '$(BUILD_DIR)/love-release.1' gzip '$(BUILD_DIR)/love-release.1'
@@ -31,7 +33,7 @@ install:
install -m 0755 -d '$(INSTALL_DIR)' '$(INSTALL_DIR)/scripts' '$(COMPLETION_DIR)' install -m 0755 -d '$(INSTALL_DIR)' '$(INSTALL_DIR)/scripts' '$(COMPLETION_DIR)'
install -m 0755 scripts/* '$(INSTALL_DIR)/scripts' install -m 0755 scripts/* '$(INSTALL_DIR)/scripts'
install -m 0644 -t '$(INSTALL_DIR)' README.md conf.lua example.sh install -m 0644 -t '$(INSTALL_DIR)' README.md conf.lua example.sh
install -m 0644 completion.sh '$(COMPLETION_DIR)/love-release' install -m 0644 '$(BUILD_DIR)/completion.sh' '$(COMPLETION_DIR)/love-release'
install -m 0644 '$(BUILD_DIR)/love-release.1.gz' '$(MANPAGE_DIR)' install -m 0644 '$(BUILD_DIR)/love-release.1.gz' '$(MANPAGE_DIR)'
embedded: clean embedded: clean

View File

@@ -6,12 +6,8 @@ _love-release()
COMPREPLY=() COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}" cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-l"
opts="$opts -w --win-icon --win-package-version --win-maintainer-name --win-package-name --win-appid --win-installer" opts="-L -a -d -e -h -i -l -p -r -t -u -v --author --clean --description --email --help --icon --love --pkg --release --title --url --version"
opts="$opts -d --deb-icon --deb-package-version --deb-maintainer-name --maintainer-email --deb-package-name"
opts="$opts -a --apk-icon --apk-activity --apk-package-version --apk-maintainer-name --apk-package-name --update-android"
opts="$opts -m --osx-icon --osx-maintainer-name"
opts="$opts -h -n -r -v -x --config --homepage --description --clean --help"
if [[ ${cur} == -* ]] ; then if [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )