summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Sipma <gueux@gueux.org>2014-10-29 15:58:53 +0100
committerFélix Sipma <gueux@gueux.org>2014-10-29 15:58:53 +0100
commit789ec043e391099b8d0ab3b4b7d1832e14df2de2 (patch)
tree22abed85aa86c7653818d5c38684e96f841c0298
parent4b7aac5db692547fcfae12b5a6f40f225e6cdb3b (diff)
bash_completion
-rw-r--r--.config/bash_completion69
1 files changed, 69 insertions, 0 deletions
diff --git a/.config/bash_completion b/.config/bash_completion
new file mode 100644
index 0000000..6ac11fb
--- /dev/null
+++ b/.config/bash_completion
@@ -0,0 +1,69 @@
+#
+# Bash completion for fabric
+#
+function _fab_complete() {
+ local cur
+ if [[ -f "fabfile.py" || -d "fabfile" ]]; then
+cur="${COMP_WORDS[COMP_CWORD]}"
+ COMPREPLY=( $(compgen -W "$(fab -F short -l)" -- ${cur}) )
+ return 0
+ else
+ # no fabfile.py found. Don't do anything.
+ return 1
+ fi
+}
+
+complete -o nospace -F _fab_complete fab
+
+
+#
+# yi yr ysh
+#
+_yi()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
+ 2> /dev/null ) )
+ return 0
+} &&
+complete -F _yi yi
+_yr()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ -f /etc/debian_version ]]; then
+ # Debian system
+ COMPREPLY=( $( \
+ _xfunc dpkg _comp_dpkg_installed_packages $cur ) )
+ else
+ # assume RPM based
+ _xfunc rpm _rpm_installed_packages
+ fi
+
+ return 0
+} &&
+complete -F _yr yr
+_ysh()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
+ 2> /dev/null ) )
+ return 0
+} &&
+complete -F _ysh ysh
+
+
+#
+# timetrap
+#
+source ~/builds/timetrap/completions/bash/timetrap-autocomplete.bash
+
+#
+# adb
+#
+source ~/builds/android-completion/android