Skip to content

Commit 90ef568

Browse files
committed
etc: add flux resource eventlog to bash completions
Problem: The `eventlog` subcommand of flux-resource(1) does not have tab completions. Add them to etc/completions/flux.pre.
1 parent 8e79bd4 commit 90ef568

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

etc/completions/flux.pre

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ _flux_submit_commands()
523523
# flux-resource(1) completions
524524
_flux_resource()
525525
{
526-
local subcmds="drain undrain status list R info reload"
526+
local subcmds="drain undrain status list R info reload eventlog"
527527
local cmd=$1
528528
local split=false
529529
local states
@@ -570,15 +570,35 @@ _flux_resource()
570570
-q --queue= \
571571
-i --include= \
572572
"
573+
local eventlog_OPTS="\
574+
-h --help \
575+
-f --format= \
576+
-T --time-format=
577+
-L --color= \
578+
-F --follor \
579+
-w --wait-event= \
580+
"
581+
573582
_flux_split_longopt && split=true
574583
case $prev in
575584
--queue | -!(-*)q)
576585
_flux_complete_queue
577586
return
578587
;;
579-
--format | -!(-*)o)
580-
_flux_complete_format_name flux resource $cmd
581-
return
588+
--format | -!(-*)o | -!(-*)f)
589+
case $cmd in
590+
eventlog)
591+
COMPREPLY=( $(compgen -W "text json" -- "$cur") )
592+
return
593+
;;
594+
*)
595+
# Only eventlog takes -f as format
596+
if test "$prev" != "-f"; then
597+
_flux_complete_format_name flux resource $cmd
598+
return
599+
fi
600+
;;
601+
esac
582602
;;
583603
--states | -!(-*)s)
584604
case $cmd in

0 commit comments

Comments
 (0)