# get the calling program, remove anything after the space == all commands arguments
local caller; caller=$(echo ${words[@]} | sed 's/ .*//g');
# get options between "vehicle type " and closing ")", remove line return, remove spaces, anything before the opening (, remove the "|" and closing ")"
# 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' | tr '\n' ' ' | sed -e 's/ //g' -e 's/.*(//g' -e 's/[|)]/ /g') )
}
}
@ -95,9 +90,6 @@ do
local_current=$(( $local_current - 1 ))
local_current=$(( $local_current - 1 ))
done
done
# get the calling program, remove anything after the space == all commands arguments
local caller; caller=$(echo ${words[@]} | sed 's/ .*//g');
# to get the vehicle list :
# to get the vehicle list :
# Get everything between "frame type" and "-C", remove first and last line, get line starting with caracters and ": " sequence, remove spaces and :
# 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 --help | sed -n '/frame type/,/-C/p' | sed -e '1d' -e '$d' | sed -n 's/\(.*: \).*/\1/p' | sed -e 's/ //g' -e 's/://g'))
@ -118,4 +110,6 @@ done
_describe -t frames 'frame' frames "$@" && ret=0
_describe -t frames 'frame' frames "$@" && ret=0
}
}
# get the calling program, remove anything after the space == all commands arguments