[lttng-dev] [PATCH lttng-tools 2/5] Reorder functions _lttng_cmd_* functions in bash completion

simon.marchi at polymtl.ca simon.marchi at polymtl.ca
Tue Aug 13 16:26:22 EDT 2013


From: Simon Marchi <simon.marchi at polymtl.ca>

Simply reorder them alphabetically to be consistent.

Signed-off-by: Simon Marchi <simon.marchi at polymtl.ca>
---
 extras/lttng-bash_completion |   68 ++++++++++++++++++++---------------------
 1 files changed, 33 insertions(+), 35 deletions(-)

diff --git a/extras/lttng-bash_completion b/extras/lttng-bash_completion
index bff8df7..d5a58f3 100644
--- a/extras/lttng-bash_completion
+++ b/extras/lttng-bash_completion
@@ -50,6 +50,17 @@ _lttng_cmd_addcontext() {
 	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)
@@ -82,10 +93,9 @@ _lttng_cmd_destroy() {
 		;;
 	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)
@@ -96,15 +106,14 @@ _lttng_cmd_enablechannel() {
 
 	case $cur in
 	-*)
-		COMPREPLY=( $(compgen -W "${enable_channel_opts}" -- $cur) )
+		COMPREPLY=( $(compgen -W "${disable_channel_opts}" -- $cur) )
 		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)
@@ -114,25 +123,19 @@ _lttng_cmd_enableevent() {
 	--channel|-c)
 		return
 		;;
-	--probe)
-		return
-		;;
-	--function)
-		return
-		;;
 	esac
 
 	case $cur in
 	-*)
-		COMPREPLY=( $(compgen -W "${enable_event_opts}" -- $cur) )
+		COMPREPLY=( $(compgen -W "${disable_event_opts}" -- $cur) )
 		return
 		;;
 	esac
 }
 
-_lttng_cmd_disablechannel() {
-	local disable_channel_opts
-	disable_channel_opts=$(lttng disable-channel --list-options)
+_lttng_cmd_enablechannel() {
+	local enable_channel_opts
+	enable_channel_opts=$(lttng enable-channel --list-options)
 
 	case $prev in
 	--session|-s)
@@ -143,15 +146,15 @@ _lttng_cmd_disablechannel() {
 
 	case $cur in
 	-*)
-		COMPREPLY=( $(compgen -W "${disable_channel_opts}" -- $cur) )
+		COMPREPLY=( $(compgen -W "${enable_channel_opts}" -- $cur) )
 		return
 		;;
 	esac
 }
 
-_lttng_cmd_disableevent() {
-	local disable_event_opts
-	disable_event_opts=$(lttng disable-event --list-options)
+_lttng_cmd_enableevent() {
+	local enable_event_opts
+	enable_event_opts=$(lttng enable-event --list-options)
 
 	case $prev in
 	--session|-s)
@@ -161,11 +164,17 @@ _lttng_cmd_disableevent() {
 	--channel|-c)
 		return
 		;;
+	--probe)
+		return
+		;;
+	--function)
+		return
+		;;
 	esac
 
 	case $cur in
 	-*)
-		COMPREPLY=( $(compgen -W "${disable_event_opts}" -- $cur) )
+		COMPREPLY=( $(compgen -W "${enable_event_opts}" -- $cur) )
 		return
 		;;
 	esac
@@ -247,17 +256,6 @@ _lttng_cmd_version() {
 	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_view() {
 	local view_opts
 		view_opts=$(lttng view --list-options)
-- 
1.7.1




More information about the lttng-dev mailing list