From: Simon Marchi Date: Mon, 29 Jul 2013 19:22:45 +0000 (-0400) Subject: bash completion: add calls to _lttng_complete_sessions X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=4a096a5baf467a5c0c1346b759b7c3ac43125ff2 bash completion: add calls to _lttng_complete_sessions Improve a little bit the dummy implementation of _lttng_complete_sessions and add two calls where it can be useful. Reported-by: Daniel U. Thibault Signed-off-by: Simon Marchi Signed-off-by: David Goulet --- diff --git a/extras/lttng-bash_completion b/extras/lttng-bash_completion index cc8155734..bff8df724 100644 --- a/extras/lttng-bash_completion +++ b/extras/lttng-bash_completion @@ -16,7 +16,12 @@ # _lttng_complete_sessions() { - # TODO, maybe have a lttng list --simple or something like that + # TODO + # This code does nothing for now. When there is a mecanism to get the + # existing sessions, use it to fill the sessions variable. + local sessions + sessions="" + COMPREPLY=( $(compgen -W "${sessions}" -- $cur) ) return } @@ -181,6 +186,9 @@ _lttng_cmd_list() { COMPREPLY=( $(compgen -W "${list_opts}" -- $cur) ) return ;; + *) + _lttng_complete_sessions + return esac } @@ -193,6 +201,10 @@ _lttng_cmd_setsession() { COMPREPLY=( $(compgen -W "${set_session_opts}" -- $cur) ) return ;; + *) + _lttng_complete_sessions + return + ;; esac }