commit c00991e2a82b58883b1bc7f2a6d0725b9b6ee851
Author: vrishab <gnome.vrb@gmail.com>
Date:   Wed Nov 16 01:30:41 2016 +0530

    Bash auto completions for rhythmbox and rhythmbox-client

diff --git a/shell/Makefile.am b/shell/Makefile.am
index 4365f32..704cee9 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -138,6 +138,9 @@ if ENABLE_PYTHON
 rhythmbox_LDADD += $(PYTHON_LIBS)
 endif
 
+completiondir = `$(PKG_CONFIG) --variable=completionsdir bash-completion`
+completion_DATA = completions/rhythmbox
+
 rb_resource_deps = $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(top_srcdir)/data --sourcedir $(top_builddir)/data $(srcdir)/rhythmbox.gresource.xml)
 
 rb-resources.c: $(rb_resource_deps) $(srcdir)/rhythmbox.gresource.xml
@@ -147,7 +150,7 @@ rb-resources.c: $(rb_resource_deps) $(srcdir)/rhythmbox.gresource.xml
 		--sourcedir="$(top_builddir)/data"	\
 		--generate-source "$(srcdir)/rhythmbox.gresource.xml"
 
-EXTRA_DIST += rhythmbox.gresource.xml
+EXTRA_DIST += rhythmbox.gresource.xml $(completion_DATA)
 
 BUILT_SOURCES += $(tab_files) rb-resources.c
 
diff --git a/shell/completions/rhythmbox b/shell/completions/rhythmbox
new file mode 100644
index 0000000..6f27220
--- /dev/null
+++ b/shell/completions/rhythmbox
@@ -0,0 +1,53 @@
+_rhythmbox()
+{
+    local cur prev words cword split
+
+    _init_completion -s || return
+
+    case $prev in
+        -'?' | --help | --help-* )
+            return
+            ;;
+        --rhythmdb-file | --playlists-file )
+            _filedir
+            return
+            ;;
+    esac
+
+    $split && return
+
+    if [[ "$cur" == -* ]]; then
+        # Passing --help-all to _parse_help clutters the output with
+        # too many gst options. So, we use --help for now.
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) )
+        [[ $COMPREPLY == *= ]] && compopt -o nospace
+        return
+    fi
+} &&
+complete -F _rhythmbox -o bashdefault -o default rhythmbox
+
+_rhythmbox_client()
+{
+    local cur prev words cword split
+
+    _init_completion -s || return
+
+    case $prev in
+        -'?' | --help )
+            return
+            ;;
+        --play-uri | --select-source | --activate-source | --play-source )
+            _filedir
+            return
+            ;;
+    esac
+
+    $split && return
+
+    if [[ "$cur" == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1"  --help )' -- "$cur" ) )
+        [[ $COMPREPLY == *= ]] && compopt -o nospace
+        return
+    fi
+} &&
+complete -F _rhythmbox_client rhythmbox-client
