[gvfs] programs: install completion files for all commands
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] programs: install completion files for all commands
- Date: Wed, 28 Jan 2015 09:24:14 +0000 (UTC)
commit 9a0fe141561e9b9217bec658c886edef0a981ab6
Author: Ondrej Holy <oholy redhat com>
Date: Mon Oct 13 19:18:45 2014 +0200
programs: install completion files for all commands
bash-completion has new completion loading code since version 1.90. The
completion files are loaded on demand, with ${completionsdir}/${command}
being sourced when a matching command is typed. This requires the
completion files to be named for all commands.
https://bugzilla.gnome.org/show_bug.cgi?id=738369
configure.ac | 1 +
programs/Makefile.am | 11 ++++----
programs/completion/Makefile.am | 40 ++++++++++++++++++++++++++++++++
programs/completion/{gvfs => gvfs-cat} | 4 +-
4 files changed, 48 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index dad9dcc..a4adfb5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -924,6 +924,7 @@ monitor/afc/Makefile
monitor/mtp/Makefile
monitor/goa/Makefile
programs/Makefile
+programs/completion/Makefile
man/Makefile
test/Makefile
po/Makefile.in
diff --git a/programs/Makefile.am b/programs/Makefile.am
index 8291acb..da18410 100644
--- a/programs/Makefile.am
+++ b/programs/Makefile.am
@@ -1,5 +1,9 @@
NULL =
+if ENABLE_BASHCOMP
+SUBDIRS = completion
+endif
+
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
@@ -33,11 +37,6 @@ bin_SCRIPTS = \
gvfs-less \
$(NULL)
-if ENABLE_BASHCOMP
-profiledir = $(BASHCOMP_DIR)
-profile_DATA = completion/gvfs
-endif
-
gvfs_cat_SOURCES = gvfs-cat.c
gvfs_cat_LDADD = $(libraries)
@@ -89,4 +88,4 @@ gvfs_mkdir_LDADD = $(libraries)
gvfs_mime_SOURCES = gvfs-mime.c
gvfs_mime_LDADD = $(libraries)
-EXTRA_DIST = gvfs-less completion/gvfs
+EXTRA_DIST = gvfs-less
diff --git a/programs/completion/Makefile.am b/programs/completion/Makefile.am
new file mode 100644
index 0000000..06833e5
--- /dev/null
+++ b/programs/completion/Makefile.am
@@ -0,0 +1,40 @@
+NULL =
+
+bashcompdir = $(BASHCOMP_DIR)
+bashcomp_DATA = gvfs-cat
+
+EXTRA_DIST = $(bashcomp_DATA)
+
+.PHONY = install-symlinks uninstall-symlinks
+
+symlinks = \
+ gvfs-copy \
+ gvfs-info \
+ gvfs-less \
+ gvfs-ls \
+ gvfs-mkdir \
+ gvfs-monitor-dir \
+ gvfs-monitor-file \
+ gvfs-move \
+ gvfs-open \
+ gvfs-rename \
+ gvfs-rm \
+ gvfs-save \
+ gvfs-set-attribute \
+ gvfs-trash \
+ gvfs-tree \
+ $(NULL)
+
+install-symlinks:
+ set -e; for file in $(symlinks); do \
+ $(LN_S) -f gvfs-cat $(DESTDIR)$(BASHCOMP_DIR)/$$file; \
+ done
+
+uninstall-symlinks:
+ set -e; for file in $(symlinks); do \
+ rm -f $(DESTDIR)$(BASHCOMP_DIR)/$$file; \
+ done
+
+install-data-local: install-symlinks
+
+uninstall-local: uninstall-symlinks
diff --git a/programs/completion/gvfs b/programs/completion/gvfs-cat
similarity index 96%
rename from programs/completion/gvfs
rename to programs/completion/gvfs-cat
index 16fdccd..4eb4dae 100755
--- a/programs/completion/gvfs
+++ b/programs/completion/gvfs-cat
@@ -17,7 +17,7 @@
#
# Author: David Zeuthen <davidz redhat com>
-# Check for bash
+# Check for bash
[ -z "$BASH_VERSION" ] && return
####################################################################################################
@@ -32,7 +32,7 @@ __gvfs_multiple_uris() {
# don't misbehave on colons; See item E13 at http://tiswww.case.edu/php/chet/bash/FAQ
# We handle this locally be extracting any BLAH: prefix and removing it from the result.
# Not great, but better than globally changing COMP_WORDBREAKS
-
+
case "$cur" in
*:*)
case "$COMP_WORDBREAKS" in
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]