Skip to content

Commit 52d5db3

Browse files
committed
completion/bash: always initialize COMP_REPLY to empty
Useful for regression testing inside a single script. Signed-off-by: Brice Goglin <[email protected]>
1 parent 7c7b52a commit 52d5db3

File tree

1 file changed

+12
-0
lines changed
  • contrib/completion/bash

1 file changed

+12
-0
lines changed

contrib/completion/bash/hwloc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ _lstopo() {
8686
)
8787
local cur=${COMP_WORDS[COMP_CWORD]}
8888
local prev=${COMP_WORDS[COMP_CWORD-1]}
89+
COMPREPLY=()
8990

9091
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
9192
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` )
@@ -196,6 +197,7 @@ _hwloc_info(){
196197
)
197198
local cur=${COMP_WORDS[COMP_CWORD]}
198199
local prev=${COMP_WORDS[COMP_CWORD-1]}
200+
COMPREPLY=()
199201

200202
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
201203
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` )
@@ -271,6 +273,7 @@ _hwloc_bind(){
271273
)
272274
local cur=${COMP_WORDS[COMP_CWORD]}
273275
local prev=${COMP_WORDS[COMP_CWORD-1]}
276+
COMPREPLY=()
274277

275278
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
276279
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` )
@@ -340,6 +343,7 @@ _hwloc_calc(){
340343
)
341344
local cur=${COMP_WORDS[COMP_CWORD]}
342345
local prev=${COMP_WORDS[COMP_CWORD-1]}
346+
COMPREPLY=()
343347

344348
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
345349
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` )
@@ -387,6 +391,7 @@ complete -F _hwloc_calc hwloc-calc
387391
_hwloc_annotate(){
388392
local OPTIONS=(--ci --ri --cu --cd --version -h --help)
389393
local cur=${COMP_WORDS[COMP_CWORD]}
394+
COMPREPLY=()
390395

391396
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
392397
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"`)
@@ -403,6 +408,7 @@ _hwloc_diff(){
403408
)
404409
local cur=${COMP_WORDS[COMP_CWORD]}
405410
local prev=${COMP_WORDS[COMP_CWORD-1]}
411+
COMPREPLY=()
406412

407413
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
408414
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` )
@@ -425,6 +431,7 @@ _hwloc_patch(){
425431
-h --help
426432
)
427433
local cur=${COMP_WORDS[COMP_CWORD]}
434+
COMPREPLY=()
428435

429436
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
430437
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` )
@@ -441,6 +448,7 @@ _hwloc_compress_dir(){
441448
-h --help
442449
)
443450
local cur=${COMP_WORDS[COMP_CWORD]}
451+
COMPREPLY=()
444452

445453
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
446454
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` )
@@ -471,6 +479,7 @@ _hwloc_distrib(){
471479
)
472480
local cur=${COMP_WORDS[COMP_CWORD]}
473481
local prev=${COMP_WORDS[COMP_CWORD-1]}
482+
COMPREPLY=()
474483

475484
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
476485
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` )
@@ -524,6 +533,7 @@ _hwloc_ps(){
524533
)
525534
local cur=${COMP_WORDS[COMP_CWORD]}
526535
local prev=${COMP_WORDS[COMP_CWORD-1]}
536+
COMPREPLY=()
527537

528538
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
529539
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` )
@@ -558,6 +568,7 @@ _hwloc_gather_cpuid(){
558568
)
559569
local cur=${COMP_WORDS[COMP_CWORD]}
560570
local prev=${COMP_WORDS[COMP_CWORD-1]}
571+
COMPREPLY=()
561572

562573
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
563574
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` )
@@ -582,6 +593,7 @@ _hwloc_gather_topology(){
582593
-h --help
583594
)
584595
local cur=${COMP_WORDS[COMP_CWORD]}
596+
COMPREPLY=()
585597

586598
if [[ $COMP_CWORD == 1 || $cur == -* ]] ; then
587599
COMPREPLY=( `compgen -W "${OPTIONS[*]}" -- "$cur"` )

0 commit comments

Comments
 (0)