+# Generates COMPREPLY with the available jul event
+_lttng_complete_jul_events() {
+ local jul_event
+ jul_event=$(lttng --mi xml list -j | xmllint --xpath "//command/output/domains/domain[./type = 'JUL']/pids/pid/events/event/name" - 2>/dev/null | sed -e "s/<name>//g" -e $"s/<\/name>/\\n/g")
+ COMPREPLY=( $(compgen -W "${jul_event}" -- $cur) )
+ return
+}
+
+
+
+# Generates COMPREPLY with whatever is in the $options variable.
+_lttng_complete_options() {
+ COMPREPLY=( $(compgen -W "${options}" -- $cur) )
+}
+
+# Generates COMPREPLY with whatever is in the $commands variable.
+_lttng_complete_commands() {
+ COMPREPLY=( $(compgen -W "${commands}" -- $cur) )
+}
+
+_lttng_cmd_addcontext() {
+ options=$(lttng add-context --list-options)