From da2a8bd62efad8e9db757dd48d5f2ed87e5848d2 Mon Sep 17 00:00:00 2001 From: Jeremy Bicha Date: Thu, 17 Jan 2013 01:20:28 -0500 Subject: shell: Rename bash completion file so that it's recognized Bash completion needs the file to be named gnome-control-center https://bugzilla.gnome.org/show_bug.cgi?id=691924 --- shell/completions/gnome-control-center.in | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 shell/completions/gnome-control-center.in (limited to 'shell/completions') diff --git a/shell/completions/gnome-control-center.in b/shell/completions/gnome-control-center.in new file mode 100644 index 000000000..37e683031 --- /dev/null +++ b/shell/completions/gnome-control-center.in @@ -0,0 +1,43 @@ +#!/bin/bash +# +# gnome-control-center tab completion for bash. + +_gnome_control_center() +{ + local cur prev command_list i v + + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -o|--overview) + command_list="" + ;; + *) + if [ $prev = "gnome-control-center" ] ; then + command_list="--overview --verbose --version" + command_list="$command_list @PANELS@" + elif [ $prev = "--verbose" ]; then + command_list="@PANELS@" + fi + + # FIXME + # Add the argvs for some of the panels that + # support it, such as network + for i in --overview --version @PANELS@; do + if [ $i = $prev ]; then + command_list="" + fi + done + ;; + esac + + for i in $command_list; do + if [ -z "${i/$cur*}" ]; then + COMPREPLY=( ${COMPREPLY[@]} $i ) + fi + done +} + +# load the completion +complete -F _gnome_control_center gnome-control-center -- cgit v1.2.1