From 2603e128818e187a11db3c52a0d6777e58d2d4d9 Mon Sep 17 00:00:00 2001 From: Sylvain Joubert Date: Wed, 3 Sep 2014 20:26:17 +0200 Subject: [PATCH] bash-completion: Complete 'ctest' label names --- Auxiliary/bash-completion/ctest | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Auxiliary/bash-completion/ctest b/Auxiliary/bash-completion/ctest index 25cb99841..327e12c59 100644 --- a/Auxiliary/bash-completion/ctest +++ b/Auxiliary/bash-completion/ctest @@ -19,8 +19,12 @@ _ctest() _filedir return ;; - -L|--label-regex|-LE|--label-exclude|--track|-I|--tests-information|\ - --max-width|--timeout|--stop-time) + -L|--label-regex|-LE|--label-exclude) + COMPREPLY=( $( compgen -W '$( ctest --print-labels 2>/dev/null | + grep "^ " 2>/dev/null | cut -d" " -f 3 )' -- "$cur" ) ) + return + ;; + --track|-I|--tests-information|--max-width|--timeout|--stop-time) # argument required but no completions available return ;;