#compdef sdk-factory.sh sdk-patch.sh sdk-test.sh sdk-qa.sh set-target-build-env.sh _sdk-targets() { _platforms () { local _targets_file=tools/sdk-targets.txt [ -f $_targets_file ] && awk '/^ [-_a-zA-Z0-9]+$/ { print $1 }' $_targets_file } _current_target () { [ -z "$TARGET" ] || \ for i in ": Standard SDK"\ "-PLUGIN: Plugin SDK"\ "-APPSDK: Advanced Plugin SDK"\ "-PERF: Performance tests" ; echo $TARGET$i } _other_targets () { for target in $( _platforms ) ; do [ "$target" = "$TARGET" ] && continue; for i in ""\ "-PLUGIN"\ "-APPSDK"\ "-PERF" ; echo $target$i done } case "$service" in sdk-factory.sh) _arguments \ {-a,--enable-all-protocols}'[Enable all protocols]'\ {-c+,--config=}'[Selects config FILE to use]:file:_files'\ {-d,--debug-make}'[Add debugging verbosity to make]'\ {-g,--enable-debug-info}'[Enable debug info in binaries]'\ {-h,--enable-host}'[Enable host binaries building]'\ {-i,--disable-security}'[Disable licence checking]'\ {-n,--nomake}'[No make done]'\ {-s,--enable-specific-protocols}'[Enable specific protocols]'\ {-v,--verbose}'[Enable verbose compilation]'\ ':current target:(( $(_current_target) ))' \ - framework \ {-f,--framework-only}'[Generates only the framework libraries]'\ - protobundle \ {-p,--protocols-only}'[Generates only the protocols bundle libraries]' _alternative ':other targets:(( $( _other_targets ) ))' ;; set-target-build-env.sh) _arguments ':platforms:(( $(_platforms) ))' ;; sdk-*) _arguments ':current target:(( $( _current_target) ))' _alternative ':other targets:(( $( _other_targets ) ))' ;; esac }