Skip to content

Commit

Permalink
Tools: Completion: fix vehicle type competion
Browse files Browse the repository at this point in the history
  • Loading branch information
khancyr authored and peterbarker committed Apr 30, 2020
1 parent 64b7e8f commit ced185b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Tools/completion/bash/_sim_vehicle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ _sim_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 --help | sed -n '/vehicle type (/,/)/p' | tr '\n' ' ' | sed -e 's/ //g' -e 's/.*(//g' -e 's/[|)]/ /g')
opts=$($caller --help | sed -n '/vehicle type/,/)/p' | sed -e '1d' | tr -d '()' | tr '\n' ' ' | sed -e 's/ //g' -e 's/.*(//g' -e 's/[|)]/ /g')
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
;;
Expand Down
2 changes: 1 addition & 1 deletion Tools/completion/zsh/_sim_vehicle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ _sim_vehicle() {

_get_vehicle_type() {
# get options between "vehicle type " and closing ")", remove line return, remove spaces, anything before the opening (, remove the "|" and closing ")"
vehicles=( $($caller --help | sed -n '/vehicle type (/,/)/p' | tr '\n' ' ' | sed -e 's/ //g' -e 's/.*(//g' -e 's/[|)]/ /g') )
vehicles=( $($caller --help | sed -n '/vehicle type/,/)/p' | sed -e '1d' | tr -d '()' | tr '\n' ' ' | sed -e 's/ //g' -e 's/.*(//g' -e 's/[|)]/ /g') )
}

(( $+functions[_sim_vehicle_vehicles] )) ||
Expand Down

0 comments on commit ced185b

Please sign in to comment.