mirror of
https://github.com/TangentFoxy/love-release.git
synced 2025-07-28 11:02:20 +00:00
Add tab-completion support
This commit is contained in:
@@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
### INSTALLATION
|
### INSTALLATION
|
||||||
Clone and run as root `install.sh`, or edit `install.sh` to choose
|
Clone and run as root `install.sh`, or edit `install.sh` to choose
|
||||||
locations in user-space.
|
locations in user-space.
|
||||||
|
Close and reopen your terminal to make completion available, or execute
|
||||||
|
`. /etc/bash_completion.d/love-release`
|
||||||
|
|
||||||
### SYNOPSIS
|
### SYNOPSIS
|
||||||
`love-release.sh [-adlmw] [-n project_name] [-r release_dir] [-v love_version] [FILES...]`
|
`love-release.sh [-adlmw] [-n project_name] [-r release_dir] [-v love_version] [FILES...]`
|
||||||
|
22
completion.sh
Normal file
22
completion.sh
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# love-release Bash completion
|
||||||
|
|
||||||
|
_love-release()
|
||||||
|
{
|
||||||
|
local cur prev opts
|
||||||
|
COMPREPLY=()
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
opts="-l"
|
||||||
|
opts="$opts -w --win-icon"
|
||||||
|
opts="$opts -d --deb-package-version --deb-maintainer-name --maintainer-email --deb-package-name"
|
||||||
|
opts="$opts -a --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
|
||||||
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
complete -F _love-release love-release
|
||||||
|
|
@@ -10,6 +10,7 @@ echo "Installing..."
|
|||||||
BINARY_DIR=/usr/bin
|
BINARY_DIR=/usr/bin
|
||||||
INSTALL_DIR=/usr/share/love-release
|
INSTALL_DIR=/usr/share/love-release
|
||||||
MANPAGE_DIR=/usr/share/man/man1
|
MANPAGE_DIR=/usr/share/man/man1
|
||||||
|
COMPLETION_DIR=/etc/bash_completion.d
|
||||||
|
|
||||||
SED_ARG=$(echo "$INSTALL_DIR" | sed -e 's/[\/&]/\\&/g')
|
SED_ARG=$(echo "$INSTALL_DIR" | sed -e 's/[\/&]/\\&/g')
|
||||||
mkdir -p "$BINARY_DIR"
|
mkdir -p "$BINARY_DIR"
|
||||||
@@ -25,5 +26,8 @@ mkdir -p "$MANPAGE_DIR"
|
|||||||
sed -e "s/scripts/$SED_ARG\/scripts/g" -e "s/config.ini/$SED_ARG\/config.ini/g" love-release.1 > "$MANPAGE_DIR"/love-release.1
|
sed -e "s/scripts/$SED_ARG\/scripts/g" -e "s/config.ini/$SED_ARG\/config.ini/g" love-release.1 > "$MANPAGE_DIR"/love-release.1
|
||||||
gzip -9 -f "$MANPAGE_DIR"/love-release.1
|
gzip -9 -f "$MANPAGE_DIR"/love-release.1
|
||||||
|
|
||||||
|
mkdir -p "COMPLETION_DIR"
|
||||||
|
cp ./completion.sh "$COMPLETION_DIR"/love-release
|
||||||
|
|
||||||
echo "Done !"
|
echo "Done !"
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
# - a dot "." if it has an optional argument
|
# - a dot "." if it has an optional argument
|
||||||
# - a colon ":" if it requires an argument
|
# - a colon ":" if it requires an argument
|
||||||
# If you need options that might conflict by their names with already defined options, please prefix them.
|
# If you need options that might conflict by their names with already defined options, please prefix them.
|
||||||
|
# If you want automatic completion to be available, add them to completion.sh
|
||||||
SCRIPT_ARGS="q; wer: ty. uiop $SCRIPT_ARGS"
|
SCRIPT_ARGS="q; wer: ty. uiop $SCRIPT_ARGS"
|
||||||
|
|
||||||
# If some options require a file or a directory as argument,
|
# If some options require a file or a directory as argument,
|
||||||
|
Reference in New Issue
Block a user