X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=extras%2Flttng-bash_completion;h=bff8df724276992d02d714e31ebc4b28d4380b80;hb=2a06df8de565dc46491480d4f2e8d4113492c3de;hp=b5f861c56a2fd55c5c2dfc6e463310a8b32cdf57;hpb=a2bccc23d7d236691f76a9e01a647f9949a09928;p=lttng-tools.git diff --git a/extras/lttng-bash_completion b/extras/lttng-bash_completion index b5f861c56..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 } @@ -146,7 +151,7 @@ _lttng_cmd_disablechannel() { _lttng_cmd_disableevent() { local disable_event_opts - disable_channel_opts=$(lttng disable-event --list-options) + disable_event_opts=$(lttng disable-event --list-options) case $prev in --session|-s) @@ -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 }