X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=extras%2Flttng-bash_completion;h=458748de11f36e599e51e0436964f4b7a03002b5;hp=335e9d128454fe3da1b5312624c9d8515b54c0d1;hb=2b00d46244cab86f1186a7b00cdc660f24a26f72;hpb=7335fad67f8c47c2339b82e0dcbf36b28dc1e6a8 diff --git a/extras/lttng-bash_completion b/extras/lttng-bash_completion index 335e9d128..458748de1 100644 --- a/extras/lttng-bash_completion +++ b/extras/lttng-bash_completion @@ -1,24 +1,13 @@ # -# Copyright (c) - 2012 Simon Marchi +# Copyright (C) 2012 Simon Marchi A # -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by as published by -# the Free Software Foundation; only version 2 of the License. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# SPDX-License-Identifier: GPL-2.0-only # # Generates COMPREPLY with the existing session names _lttng_complete_sessions() { local sessions - sessions=$(lttng --mi xml list | xmllint --xpath "//command/output/sessions/session/name" - 2>/dev/null | sed -e 's///g' -e $'s/<\/name>/\\n/g') + sessions=$(lttng --mi xml list | sed '2 s/xmlns/ignore/g' | xmllint --xpath "//command/output/sessions/session/name" - 2>/dev/null | sed -e 's///g' -e $'s/<\/name>/\\n/g') COMPREPLY=( $(compgen -W "${sessions}" -- $cur) ) return } @@ -27,7 +16,7 @@ _lttng_complete_sessions() { # Generates COMPREPLY with the available kernel event _lttng_complete_kernel_events() { local kernel_event - kernel_event=$(lttng --mi xml list -k | xmllint --xpath "//command/output/domains/domain[./type = 'KERNEL']/events/event/name" - 2>/dev/null | sed -e "s///g" -e $"s/<\/name>/\\n/g") + kernel_event=$(lttng --mi xml list -k |sed '2 s/xmlns/ignore/g' | xmllint --xpath "//command/output/domains/domain[./type = 'KERNEL']/events/event/name" - 2>/dev/null | sed -e "s///g" -e $"s/<\/name>/\\n/g") COMPREPLY=( $(compgen -W "${kernel_event}" -- $cur) ) return } @@ -35,7 +24,7 @@ _lttng_complete_kernel_events() { # Generates COMPREPLY with the available ust event _lttng_complete_ust_events() { local ust_event - ust_event=$(lttng --mi xml list -u | xmllint --xpath "//command/output/domains/domain[./type = 'UST']/pids/pid/events/event/name" - 2>/dev/null | sed -e "s///g" -e $"s/<\/name>/\\n/g") + ust_event=$(lttng --mi xml list -u | sed '2 s/xmlns/ignore/g' | xmllint --xpath "//command/output/domains/domain[./type = 'UST']/pids/pid/events/event/name" - 2>/dev/null | sed -e "s///g" -e $"s/<\/name>/\\n/g") COMPREPLY=( $(compgen -W "${ust_event}" -- $cur) ) return } @@ -43,7 +32,7 @@ _lttng_complete_ust_events() { # 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///g" -e $"s/<\/name>/\\n/g") + jul_event=$(lttng --mi xml list -j | sed '2 s/xmlns/ignore/g' | xmllint --xpath "//command/output/domains/domain[./type = 'JUL']/pids/pid/events/event/name" - 2>/dev/null | sed -e "s///g" -e $"s/<\/name>/\\n/g") COMPREPLY=( $(compgen -W "${jul_event}" -- $cur) ) return } @@ -84,17 +73,6 @@ _lttng_cmd_addcontext() { esac } -_lttng_cmd_calibrate() { - options=$(lttng calibrate --list-options) - - case $cur in - -*) - _lttng_complete_options - return - ;; - esac -} - _lttng_cmd_create() { options=$(lttng create --list-options)