X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=extras%2Flttng-bash_completion;h=bff8df724276992d02d714e31ebc4b28d4380b80;hb=2a06df8de565dc46491480d4f2e8d4113492c3de;hp=a90820ab42c65d98fd1c1284c76d7474f70303b7;hpb=6c806062d2b535701bd5dcce4d3b41fe46a69670;p=lttng-tools.git diff --git a/extras/lttng-bash_completion b/extras/lttng-bash_completion index a90820ab4..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 } @@ -125,44 +130,6 @@ _lttng_cmd_enableevent() { esac } -_lttng_cmd_enableconsumer() { - local enable_consumer_opts - enable_consumer_opts=$(lttng enable-consumer --list-options) - - case $prev in - --session|-s) - _lttng_complete_sessions - return - ;; - esac - - case $cur in - -*) - COMPREPLY=( $(compgen -W "${enable_consumer_opts}" -- $cur) ) - return - ;; - esac -} - -_lttng_cmd_disableconsumer() { - local disable_consumer_opts - disable_consumer_opts=$(lttng disable-consumer --list-options) - - case $prev in - --session|-s) - _lttng_complete_sessions - return - ;; - esac - - case $cur in - -*) - COMPREPLY=( $(compgen -W "${disable_consumer_opts}" -- $cur) ) - return - ;; - esac -} - _lttng_cmd_disablechannel() { local disable_channel_opts disable_channel_opts=$(lttng disable-channel --list-options) @@ -184,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) @@ -219,6 +186,9 @@ _lttng_cmd_list() { COMPREPLY=( $(compgen -W "${list_opts}" -- $cur) ) return ;; + *) + _lttng_complete_sessions + return esac } @@ -231,6 +201,10 @@ _lttng_cmd_setsession() { COMPREPLY=( $(compgen -W "${set_session_opts}" -- $cur) ) return ;; + *) + _lttng_complete_sessions + return + ;; esac }