[tracker/tracker-cmd: 5/6] tracker: Added bash completion
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-cmd: 5/6] tracker: Added bash completion
- Date: Mon, 6 Oct 2014 11:04:24 +0000 (UTC)
commit 55637c3bc359ed58df32efeac77f3418a1d570ee
Author: Martyn Russell <martyn lanedo com>
Date: Mon Oct 6 11:35:07 2014 +0100
tracker: Added bash completion
src/tracker/Makefile.am | 4 ++++
src/tracker/tracker-prompt.sh | 10 ++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker/Makefile.am b/src/tracker/Makefile.am
index 5652f01..aae8817 100644
--- a/src/tracker/Makefile.am
+++ b/src/tracker/Makefile.am
@@ -54,3 +54,7 @@ tracker_LDADD = \
$(top_builddir)/src/libtracker-common/libtracker-common.la \
$(BUILD_LIBS) \
$(TRACKER_LIBS)
+
+# Bash completion
+completion_dir = $(sysconfdir)/bash_completion.d
+completion_DATA = tracker-prompt.sh
diff --git a/src/tracker/tracker-prompt.sh b/src/tracker/tracker-prompt.sh
new file mode 100644
index 0000000..8022b6a
--- /dev/null
+++ b/src/tracker/tracker-prompt.sh
@@ -0,0 +1,10 @@
+#-*- mode: shell-script;-*-
+
+tracker_cmds()
+{
+ possible=`tracker | egrep " [a-z].* " | awk '{ print ($1) }'`
+ local cur=${COMP_WORDS[COMP_CWORD]}
+ COMPREPLY=( $(compgen -W "$possible" -- $cur) )
+}
+
+complete -F tracker_cmds tracker
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]