Message ID | 20220323225016.3a3a7034@gandalf.local.home (mailing list archive) |
---|---|
State | Accepted |
Commit | ec198af190425711b87fff2ef0dc4c965daf411a |
Headers | show |
Series | trace-cmd: Fix bash completions for non specified commands | expand |
diff --git a/tracecmd/trace-cmd.bash b/tracecmd/trace-cmd.bash index 6639c1433678..66bd6f4bf2dd 100644 --- a/tracecmd/trace-cmd.bash +++ b/tracecmd/trace-cmd.bash @@ -52,7 +52,7 @@ cmd_options() sed -e 's/ *\(-[^ ]*\).*/\1/') COMPREPLY=( $(compgen -W "${cmds}" -- "${cur}") ) if [ ${#COMPREPLY[@]} -eq 0 ]; then - __show_files "$cur" + __show_files "${cur}" fi } @@ -276,10 +276,12 @@ __show_command_options() done fi COMPREPLY=( $(compgen -W "${opts}" -- "$cur")) - return 0 + break fi done - __show_files "$cur" + if [ ${#COMPREPLY[@]} -eq 0 ]; then + __show_files "${cur}" + fi } _trace_cmd_complete()