X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=extras%2Flttng-bash_completion;h=bff8df724276992d02d714e31ebc4b28d4380b80;hb=4a096a5baf467a5c0c1346b759b7c3ac43125ff2;hp=9aacb029491793d471b65810b5e1281e06fd2de7;hpb=0c95f5b2ec754e905a0263cafc6e453f451d0ded;p=lttng-tools.git diff --git a/extras/lttng-bash_completion b/extras/lttng-bash_completion index 9aacb0294..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) @@ -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 }