From aac416deb1050f21c9d2cc7853a7f699a908deb2 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Mon, 3 Aug 2020 14:37:28 +0200 Subject: [PATCH] Tools: completion: simplify bash completion for sim_vehicle.py --- Tools/completion/bash/_sim_vehicle | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Tools/completion/bash/_sim_vehicle b/Tools/completion/bash/_sim_vehicle index 5414df3996..8b1d63a815 100644 --- a/Tools/completion/bash/_sim_vehicle +++ b/Tools/completion/bash/_sim_vehicle @@ -64,7 +64,6 @@ _sim_vehicle() { -v | --vehicle) # get the calling program, remove anything after the space == all commands arguments local caller; caller=$(echo $@ | sed 's/ .*//g'); - # get options between "vehicle type " and closing ")", remove line return, remove spaces, anything before the opening (, remove the "|" and closing ")" opts=$($caller --list-vehicle) COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 @@ -72,8 +71,7 @@ _sim_vehicle() { -f | --frame) # get the calling program, remove anything after the space == all commands arguments local caller; caller=$(echo $@ | sed 's/ .*//g'); - # Get everything between "frame type" and "-C", remove first and last line, get line starting with caracters and ": " sequence, remove spaces and : - local supported_vehicle_list=$($caller --help | sed -n '/frame type/,/-C/p' | sed -e '1d' -e '$d' | sed -n 's/\(.*: \).*/\1/p' | sed -e 's/ //g' -e 's/://g') + local supported_vehicle_list=$($caller --list-vehicle) local frames; for v in $supported_vehicle_list do