diff options
author | Bernd Weimer <bernd.weimer@pelagicore.com> | 2018-03-02 15:42:01 +0100 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2018-03-02 15:08:34 +0000 |
commit | c13638ab065f860aad4ddceced9e8cecd75f6857 (patch) | |
tree | c0b8b9bc948b83e89cee0ca243ed27499f127163 /util | |
parent | 396399e4725a53b3cc54351e1a12d69627c4973a (diff) | |
download | qtapplicationmanager-c13638ab065f860aad4ddceced9e8cecd75f6857.tar.gz |
Add basic bash completion for appman executable
Also documented start-session-dbus option.
Change-Id: Ib5279ef8677b45226720e047c62f217fbe9fba5a
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/bash/README | 6 | ||||
-rw-r--r-- | util/bash/appman-prompt | 22 |
2 files changed, 24 insertions, 4 deletions
diff --git a/util/bash/README b/util/bash/README index 1702f83b..cab1f365 100644 --- a/util/bash/README +++ b/util/bash/README @@ -1,7 +1,7 @@ Abstract ======== The appman-prompt script provides command completion inside a bash shell for -the appman-controller and appman-packager commands. +the appman executable, appman-controller and appman-packager commands. Installation ============ @@ -17,8 +17,8 @@ Afterwards completion will be available in new shells. Notes ===== -(Sub-)Command options are currently not supported, only the general ones (help -and version). +(Sub-)Command options for the appman-controller and appman-packager are +currently not supported, only the general ones (help and version). Users of the zsh shell might want to run the following commands to get going: autoload bashcompinit diff --git a/util/bash/appman-prompt b/util/bash/appman-prompt index 554bef90..5bdedd1a 100644 --- a/util/bash/appman-prompt +++ b/util/bash/appman-prompt @@ -26,12 +26,32 @@ ## ############################################################################# +_appman() +{ + local cur opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + opts="--app-image-mount-dir --build-config --builtin-apps-manifest-dir -c --clear-config-cache --config-file \ +--database --dbus --force-multi-process --force-single-process --fullscreen --help -I \ +--installed-apps-manifest-dir --load-dummydata --logging-rule --no-config-cache --no-dlt-logging \ +--no-fullscreen --no-security --no-ui-watchdog -o --option --qml-debug --recreate-database -r --single-app \ +--slow-animations --start-session-dbus --verbose --version --wayland-socket-name" + + if [[ ${cur} == -* ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + else + COMPREPLY=( $( compgen -f -- ${cur}) ) + fi +} +complete -o filenames -F _appman appman + _appman-controller() { local cur commands opts pos args COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" - commands="start-application debug-application stop-application stop-all-applications list-applications show-application install-package remove-package list-installation-locations show-installation-location" + commands="start-application debug-application stop-application stop-all-applications list-applications \ +show-application install-package remove-package list-installation-locations show-installation-location" opts="-h -v --help --version" if [ ${COMP_CWORD} -eq 1 ] && [[ ${cur} == -* ]] ; then |