From b39cad4e48a261b9b41c80592313b52044edfc87 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Tue, 3 Jul 2012 11:14:49 +0200 Subject: [Completion] w00t. --- net:foret/completion/_sdk-factory | 23 -------------- net:foret/completion/_sdk-targets | 64 +++++++++++++++++++++++++++++++++------ net:foret/completion/_set-target | 6 ---- 3 files changed, 54 insertions(+), 39 deletions(-) delete mode 100644 net:foret/completion/_sdk-factory delete mode 100644 net:foret/completion/_set-target diff --git a/net:foret/completion/_sdk-factory b/net:foret/completion/_sdk-factory deleted file mode 100644 index 762b1e3..0000000 --- a/net:foret/completion/_sdk-factory +++ /dev/null @@ -1,23 +0,0 @@ -#compdef sdk-factory.sh - -local arguments -arguments=( - '(-s)'{-a,--enable-all-protocols}'[Enable all protocols]' - {-c+,--config=}'[Selects config FILE to use]:file:_files' - {-d,--debug-make}'[Add debugging verbosity to make]' - '(-p)'{-f,--framework-only}'[Generates only the framework libraries]' - '(-f)'{-p,--protocols-only}'[Generates only the protocols bundle libraries]' - {-g,--enable-debug-info}'[Enable debug info in binaries]' - {-h,--enable-host}'[Enable host binaries building]' - {-n,--nomake}'[No make done]' - {-s,--enable-specific-protocols}'[Enable specific protocols]' - {-v,--verbose}'[Enable verbose compilation]' - '1:targets:(($([ -n "$TARGET" ] && for i in "\:Standard_SDK"\ - "-PLUGIN\:Plugin_SDK"\ - "-APPSDK\:Advanced_Plugin_SDK"\ - "-PERF\:Performance_tests" ;\ - echo $TARGET$i)))' - ) - -_arguments $arguments - diff --git a/net:foret/completion/_sdk-targets b/net:foret/completion/_sdk-targets index 4319c8c..1f655c7 100644 --- a/net:foret/completion/_sdk-targets +++ b/net:foret/completion/_sdk-targets @@ -1,13 +1,57 @@ -#compdef sdk-patch.sh sdk-test.sh sdk-qa.sh +#compdef sdk-factory.sh sdk-patch.sh sdk-test.sh sdk-qa.sh set-target-build-env.sh -local arguments -arguments=( - '1:targets:(($([ -n "$TARGET" ] && for i in "\:Standard_SDK"\ - "-PLUGIN\:Plugin_SDK"\ - "-APPSDK\:Advanced_Plugin_SDK"\ - "-PERF\:Performance_tests" ;\ - echo $TARGET$i)))' - ) +_sdk-targets() { -_arguments $arguments + _platforms () { + awk '/^ [-_a-zA-Z0-9]+$/ { print $1 }' tools/sdk-targets.txt + } + _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 ":${target} Standard SDK"\ + "-PLUGIN:${target} Plugin SDK"\ + "-APPSDK:${target} Advanced Plugin SDK"\ + "-PERF:${target} Performance tests" ; + + echo $target$i + done + } + + case "$service" in + sdk-factory.sh) + _arguments \ + '(-s)'{-a,--enable-all-protocols}'[Enable all protocols]'\ + {-c+,--config=}'[Selects config FILE to use]:file:_files'\ + {-d,--debug-make}'[Add debugging verbosity to make]'\ + '(-p)'{-f,--framework-only}'[Generates only the framework libraries]'\ + '(-f)'{-p,--protocols-only}'[Generates only the protocols bundle libraries]'\ + {-g,--enable-debug-info}'[Enable debug info in binaries]'\ + {-h,--enable-host}'[Enable host binaries building]'\ + {-n,--nomake}'[No make done]'\ + {-s,--enable-specific-protocols}'[Enable specific protocols]'\ + {-v,--verbose}'[Enable verbose compilation]'\ + ':current target:(( $(_current_target) ))' + _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 + +} diff --git a/net:foret/completion/_set-target b/net:foret/completion/_set-target deleted file mode 100644 index 53291a8..0000000 --- a/net:foret/completion/_set-target +++ /dev/null @@ -1,6 +0,0 @@ -#compdef set-target-build-env.sh - -_arguments "1:build targets:($( - awk '/^ [-_a-zA-Z0-9]+$/ { print $1 }' tools/sdk-targets.txt - ))" - -- cgit v1.2.3