summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2012-07-03 11:14:49 +0200
committerHugues Hiegel <hugues.hiegel@qosmos.com>2012-07-03 11:14:49 +0200
commitb39cad4e48a261b9b41c80592313b52044edfc87 (patch)
treeea0b75f90f0f4ec18988a1917f8f543ff80ae5ef
parentdfeff1c6a00a62da42944dad3e6ee26189af0529 (diff)
[Completion] w00t.
-rw-r--r--net:foret/completion/_sdk-factory23
-rw-r--r--net:foret/completion/_sdk-targets64
-rw-r--r--net:foret/completion/_set-target6
3 files changed, 54 insertions, 39 deletions
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
- ))"
-