[tracker/wip/carlosg/cli-improvements: 2/8] tracker: Update bash completion script
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/cli-improvements: 2/8] tracker: Update bash completion script
- Date: Wed, 19 Aug 2020 11:31:27 +0000 (UTC)
commit 5d701a77ab5196d4f1a29152f09a6a59b806e626
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Aug 18 16:05:23 2020 +0200
tracker: Update bash completion script
Make it use the right tracker3 tool for autocompletion, and add some
more autocompletion sugar: Add more options that handle dirs or filenames,
and add completion for DBus names implementing endpoints.
src/tracker/bash-completion/tracker | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/tracker/bash-completion/tracker b/src/tracker/bash-completion/tracker
index dad5dee5d..568ed7872 100644
--- a/src/tracker/bash-completion/tracker
+++ b/src/tracker/bash-completion/tracker
@@ -1,6 +1,6 @@
#-*- mode: shell-script;-*-
-tracker_cmds()
+tracker3_cmds()
{
local cur prev words cword
_init_completion -s || return
@@ -8,7 +8,7 @@ tracker_cmds()
cur=${COMP_WORDS[COMP_CWORD]}
if [[ $cword == 1 ]]; then
- possible=`tracker | egrep " [a-z].* " | awk '{ print ($1) }'`
+ possible=`tracker3 | egrep " [a-z].* " | awk '{ print ($1) }' | sort | uniq`
COMPREPLY=( $(compgen -W "$possible" -- $cur) )
return 0;
fi
@@ -17,12 +17,17 @@ tracker_cmds()
-h|--help)
return 0;
;;
- extract|info|-f|--file)
+ extract|info|-f|--file|-d|--database|-a|--add|-d|--remove)
if [[ $cur != -* ]]; then
_filedir
return 0;
fi
;;
+ -b|--dbus-service)
+ possible=`tracker3 endpoint --list`
+ COMPREPLY=( $(compgen -W "$possible" -- $cur) )
+ return 0;
+ ;;
*)
;;
esac
@@ -37,4 +42,4 @@ tracker_cmds()
fi
}
-complete -F tracker_cmds tracker
+complete -F tracker3_cmds tracker3
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]