summaryrefslogtreecommitdiffstats
path: root/subprojects/extensions-tool/completion/bash/gnome-extensions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:54:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:54:43 +0000
commite4283f6d48b98e764b988b43bbc86b9d52e6ec94 (patch)
treec8f7f7a6c2f5faa2942d27cefc6fd46cca492656 /subprojects/extensions-tool/completion/bash/gnome-extensions
parentInitial commit. (diff)
downloadgnome-shell-e4283f6d48b98e764b988b43bbc86b9d52e6ec94.tar.xz
gnome-shell-e4283f6d48b98e764b988b43bbc86b9d52e6ec94.zip
Adding upstream version 43.9.upstream/43.9upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'subprojects/extensions-tool/completion/bash/gnome-extensions')
-rw-r--r--subprojects/extensions-tool/completion/bash/gnome-extensions91
1 files changed, 91 insertions, 0 deletions
diff --git a/subprojects/extensions-tool/completion/bash/gnome-extensions b/subprojects/extensions-tool/completion/bash/gnome-extensions
new file mode 100644
index 0000000..05cd039
--- /dev/null
+++ b/subprojects/extensions-tool/completion/bash/gnome-extensions
@@ -0,0 +1,91 @@
+
+# Check for bash
+[ -z "$BASH_VERSION" ] && return
+
+################################################################################
+
+__gnome_extensions() {
+ local commands="version enable disable reset info install show list create pack prefs uninstall"
+ local COMMAND=${COMP_WORDS[1]}
+
+ _init_completion -s || return
+
+ case "${COMP_CWORD}" in
+ 1)
+ COMPREPLY=($(compgen -W "help $commands" -- "$2"))
+ return 0
+ ;;
+
+ 2)
+ case "$COMMAND" in
+ help)
+ COMPREPLY=($(compgen -W "$commands" -- "$2"))
+ return 0
+ ;;
+
+ disable)
+ local list_opt=--enabled
+ ;;&
+ enable)
+ local list_opt=--disabled
+ ;;&
+ prefs)
+ local list_opt=--prefs
+ ;;&
+ uninstall)
+ local list_opt=--user
+ ;;&
+ enable|disable|info|show|prefs|reset|uninstall)
+ COMPREPLY=($(compgen -W "`gnome-extensions list $list_opt`" -- "$2"))
+ return 0
+ ;;
+ esac
+ ;;
+ esac
+
+ case "$COMMAND" in
+ create)
+ case "$prev" in
+ --template)
+ COMPREPLY=($(compgen -W "`gnome-extensions create --list-templates`" -- "$2"))
+ return 0
+ ;;
+ esac
+ ;;
+ pack)
+ case "$prev" in
+ --podir|--out-dir|-o)
+ _filedir -d
+ return 0
+ ;;
+ --schema)
+ _filedir gschema.xml
+ return 0
+ ;;
+ --extra-source)
+ _filedir
+ return 0
+ ;;
+ esac
+ ;;
+ install)
+ if [[ $cur != -* ]]
+ then
+ _filedir zip
+ return 0
+ fi
+ ;;
+ esac
+
+ # Stop if we are currently waiting for an option value
+ $split && return
+
+ # Otherwise, get the supported options for ${COMMAND} (if any)
+ COMPREPLY=($(compgen -W "$(_parse_help $1 "help $COMMAND")" -- "$2"))
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+}
+
+################################################################################
+
+complete -F __gnome_extensions gnome-extensions