projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reorder functions _lttng_cmd_* functions in bash completion
[lttng-tools.git]
/
extras
/
lttng-bash_completion
diff --git
a/extras/lttng-bash_completion
b/extras/lttng-bash_completion
index 00ac17ef0abf86d48e0a31999b0380581167bb8f..d5a58f38da5bc9b0e4d3bfef004a846e2fad91d2 100644
(file)
--- a/
extras/lttng-bash_completion
+++ b/
extras/lttng-bash_completion
@@
-16,11
+16,16
@@
#
_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
}
-_lttng_cmd_add
_
context() {
+_lttng_cmd_addcontext() {
local add_context_opts
add_context_opts=$(lttng add-context --list-options)
local add_context_opts
add_context_opts=$(lttng add-context --list-options)
@@
-32,9
+37,6
@@
_lttng_cmd_add_context() {
--channel|-c)
return
;;
--channel|-c)
return
;;
- --event|-e)
- return
- ;;
--type|-t)
return
;;
--type|-t)
return
;;
@@
-48,6
+50,17
@@
_lttng_cmd_add_context() {
esac
}
esac
}
+_lttng_cmd_calibrate() {
+ local calibrate_opts
+ calibrate_opts=$(lttng calibrate --list-options)
+
+ case $cur in
+ -*)
+ COMPREPLY=( $(compgen -W "${calibrate_opts}" -- $cur) )
+ ;;
+ esac
+}
+
_lttng_cmd_create() {
local create_opts
create_opts=$(lttng create --list-options)
_lttng_cmd_create() {
local create_opts
create_opts=$(lttng create --list-options)
@@
-80,10
+93,9
@@
_lttng_cmd_destroy() {
;;
esac
}
;;
esac
}
-
-_lttng_cmd_enablechannel() {
- local enable_channel_opts
- enable_channel_opts=$(lttng enable-channel --list-options)
+_lttng_cmd_disablechannel() {
+ local disable_channel_opts
+ disable_channel_opts=$(lttng disable-channel --list-options)
case $prev in
--session|-s)
case $prev in
--session|-s)
@@
-94,15
+106,14
@@
_lttng_cmd_enablechannel() {
case $cur in
-*)
case $cur in
-*)
- COMPREPLY=( $(compgen -W "${
en
able_channel_opts}" -- $cur) )
+ COMPREPLY=( $(compgen -W "${
dis
able_channel_opts}" -- $cur) )
return
;;
esac
}
return
;;
esac
}
-
-_lttng_cmd_enableevent() {
- local enable_event_opts
- enable_event_opts=$(lttng enable-event --list-options)
+_lttng_cmd_disableevent() {
+ local disable_event_opts
+ disable_event_opts=$(lttng disable-event --list-options)
case $prev in
--session|-s)
case $prev in
--session|-s)
@@
-112,25
+123,19
@@
_lttng_cmd_enableevent() {
--channel|-c)
return
;;
--channel|-c)
return
;;
- --probe)
- return
- ;;
- --function)
- return
- ;;
esac
case $cur in
-*)
esac
case $cur in
-*)
- COMPREPLY=( $(compgen -W "${
en
able_event_opts}" -- $cur) )
+ COMPREPLY=( $(compgen -W "${
dis
able_event_opts}" -- $cur) )
return
;;
esac
}
return
;;
esac
}
-_lttng_cmd_
dis
ablechannel() {
- local
dis
able_channel_opts
-
disable_channel_opts=$(lttng dis
able-channel --list-options)
+_lttng_cmd_
en
ablechannel() {
+ local
en
able_channel_opts
+
enable_channel_opts=$(lttng en
able-channel --list-options)
case $prev in
--session|-s)
case $prev in
--session|-s)
@@
-141,15
+146,15
@@
_lttng_cmd_disablechannel() {
case $cur in
-*)
case $cur in
-*)
- COMPREPLY=( $(compgen -W "${
dis
able_channel_opts}" -- $cur) )
+ COMPREPLY=( $(compgen -W "${
en
able_channel_opts}" -- $cur) )
return
;;
esac
}
return
;;
esac
}
-_lttng_cmd_
disable_
event() {
- local
dis
able_event_opts
-
disable_channel_opts=$(lttng dis
able-event --list-options)
+_lttng_cmd_
enable
event() {
+ local
en
able_event_opts
+
enable_event_opts=$(lttng en
able-event --list-options)
case $prev in
--session|-s)
case $prev in
--session|-s)
@@
-159,11
+164,17
@@
_lttng_cmd_disable_event() {
--channel|-c)
return
;;
--channel|-c)
return
;;
+ --probe)
+ return
+ ;;
+ --function)
+ return
+ ;;
esac
case $cur in
-*)
esac
case $cur in
-*)
- COMPREPLY=( $(compgen -W "${
dis
able_event_opts}" -- $cur) )
+ COMPREPLY=( $(compgen -W "${
en
able_event_opts}" -- $cur) )
return
;;
esac
return
;;
esac
@@
-171,7
+182,7
@@
_lttng_cmd_disable_event() {
_lttng_cmd_list() {
local list_opts
_lttng_cmd_list() {
local list_opts
-
disable_channel
_opts=$(lttng list --list-options)
+
list
_opts=$(lttng list --list-options)
case $prev in
--channel|-c)
case $prev in
--channel|-c)
@@
-184,10
+195,13
@@
_lttng_cmd_list() {
COMPREPLY=( $(compgen -W "${list_opts}" -- $cur) )
return
;;
COMPREPLY=( $(compgen -W "${list_opts}" -- $cur) )
return
;;
+ *)
+ _lttng_complete_sessions
+ return
esac
}
esac
}
-_lttng_cmd_set
_
session() {
+_lttng_cmd_setsession() {
local set_session_opts
set_session_opts=$(lttng set-session --list-options)
local set_session_opts
set_session_opts=$(lttng set-session --list-options)
@@
-196,6
+210,10
@@
_lttng_cmd_set_session() {
COMPREPLY=( $(compgen -W "${set_session_opts}" -- $cur) )
return
;;
COMPREPLY=( $(compgen -W "${set_session_opts}" -- $cur) )
return
;;
+ *)
+ _lttng_complete_sessions
+ return
+ ;;
esac
}
esac
}
@@
-238,13
+256,13
@@
_lttng_cmd_version() {
esac
}
esac
}
-_lttng_cmd_
calibrate
() {
- local
calibrate
_opts
-
calibrate_opts=$(lttng calibrate
--list-options)
+_lttng_cmd_
view
() {
+ local
view
_opts
+
view_opts=$(lttng view
--list-options)
- case $cur in
- -*)
- COMPREPLY=( $(compgen -W "${
calibrate
_opts}" -- $cur) )
+
case $cur in
+
-*)
+ COMPREPLY=( $(compgen -W "${
view
_opts}" -- $cur) )
;;
esac
}
;;
esac
}
This page took
0.033121 seconds
and
4
git commands to generate.