bash completion: add calls to _lttng_complete_sessions
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 29 Jul 2013 19:22:45 +0000 (15:22 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 6 Aug 2013 10:42:55 +0000 (06:42 -0400)
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 <daniel.thibault@drdc-rddc.gc.ca>
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
extras/lttng-bash_completion

index cc8155734a4df0dbfae5743d8a37646ca9439f95..bff8df724276992d02d714e31ebc4b28d4380b80 100644 (file)
 #
 
 _lttng_complete_sessions() {
 #
 
 _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
 }
 
        return
 }
 
@@ -181,6 +186,9 @@ _lttng_cmd_list() {
                COMPREPLY=( $(compgen -W "${list_opts}" -- $cur) )
                return
                ;;
                COMPREPLY=( $(compgen -W "${list_opts}" -- $cur) )
                return
                ;;
+       *)
+               _lttng_complete_sessions
+               return
        esac
 }
 
        esac
 }
 
@@ -193,6 +201,10 @@ _lttng_cmd_setsession() {
                COMPREPLY=( $(compgen -W "${set_session_opts}" -- $cur) )
                return
                ;;
                COMPREPLY=( $(compgen -W "${set_session_opts}" -- $cur) )
                return
                ;;
+       *)
+               _lttng_complete_sessions
+               return
+               ;;
        esac
 }
 
        esac
 }
 
This page took 0.026061 seconds and 4 git commands to generate.