diff options
author | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2013-11-13 17:21:25 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@qosmos.com> | 2013-11-13 17:21:25 +0100 |
commit | 393b35f2668ded754b60d5f0fe61e02fa2175f60 (patch) | |
tree | f228b01c1767650714a54c28ff087c27c1c077b1 /net:foret/completion/_endurance | |
parent | 21fd31d52bc1c2dd8b90f81a560a0bf16556b8db (diff) |
[Completion] Endurance series.
Diffstat (limited to 'net:foret/completion/_endurance')
-rw-r--r-- | net:foret/completion/_endurance | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/net:foret/completion/_endurance b/net:foret/completion/_endurance new file mode 100644 index 0000000..b37a266 --- /dev/null +++ b/net:foret/completion/_endurance @@ -0,0 +1,27 @@ +#compdef do.sh + +_endurance() { + + list-commands () { + grep '^[[:blank:]]*".*"[[:blank:]]*)' do.sh | tr '")\t|\n' ' ' | tr -s ' ' + } + + list-tests () { + echo all + find /mnt/endurancetesting/ -mindepth 1 -maxdepth 1 -type d ! -name '.*' | cut -d'/' -f4 + } + + list-nodes () { + < /mnt/endurancetesting/planning awk '!/^#|^$/ { if ( ! seen[$1] ) { seen[$1]=1 ; print $1 } }' + } + + case "$service" in + do.sh) + _arguments \ + ':actions:(( $(list-commands) ))' \ + ':tests:(( $(list-tests) ))' \ + ':nodes:(( $(list-nodes) ))' + ;; + esac + +} |