X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=extras%2Flttng-bash_completion;h=bff8df724276992d02d714e31ebc4b28d4380b80;hb=2a06df8de565dc46491480d4f2e8d4113492c3de;hp=00ac17ef0abf86d48e0a31999b0380581167bb8f;hpb=fc256d995013fb0557601fd203531493e1dacff7;p=lttng-tools.git diff --git a/extras/lttng-bash_completion b/extras/lttng-bash_completion index 00ac17ef0..bff8df724 100644 --- a/extras/lttng-bash_completion +++ b/extras/lttng-bash_completion @@ -16,11 +16,16 @@ # _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 } -_lttng_cmd_add_context() { +_lttng_cmd_addcontext() { local add_context_opts add_context_opts=$(lttng add-context --list-options) @@ -32,9 +37,6 @@ _lttng_cmd_add_context() { --channel|-c) return ;; - --event|-e) - return - ;; --type|-t) return ;; @@ -147,9 +149,9 @@ _lttng_cmd_disablechannel() { esac } -_lttng_cmd_disable_event() { +_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) @@ -171,7 +173,7 @@ _lttng_cmd_disable_event() { _lttng_cmd_list() { local list_opts - disable_channel_opts=$(lttng list --list-options) + list_opts=$(lttng list --list-options) case $prev in --channel|-c) @@ -184,10 +186,13 @@ _lttng_cmd_list() { COMPREPLY=( $(compgen -W "${list_opts}" -- $cur) ) return ;; + *) + _lttng_complete_sessions + return esac } -_lttng_cmd_set_session() { +_lttng_cmd_setsession() { local set_session_opts set_session_opts=$(lttng set-session --list-options) @@ -196,6 +201,10 @@ _lttng_cmd_set_session() { COMPREPLY=( $(compgen -W "${set_session_opts}" -- $cur) ) return ;; + *) + _lttng_complete_sessions + return + ;; esac } @@ -249,6 +258,17 @@ _lttng_cmd_calibrate() { esac } +_lttng_cmd_view() { + local view_opts + view_opts=$(lttng view --list-options) + + case $cur in + -*) + COMPREPLY=( $(compgen -W "${view_opts}" -- $cur) ) + ;; + esac +} + _lttng_opts() { local opts opts=$(lttng --list-options)