From 17a8eab9583c80e42b40a343b3b646b246acdfc8 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Mar 14 2016 13:23:41 +0000 Subject: Fix bash completion. Signed-off-by: Lubomír Sedlář --- diff --git a/src/fedpkg.bash b/src/fedpkg.bash index 8e717fb..6aac2c0 100644 --- a/src/fedpkg.bash +++ b/src/fedpkg.bash @@ -90,7 +90,7 @@ _fedpkg() # parse command specific options local options= - local options_target= options_arches= options_branch= options_string= options_file= options_dir= options_srpm= options_mroot= + local options_target= options_arches= options_branch= options_string= options_file= options_dir= options_srpm= options_mroot= options_builder= local after= after_more= case $command in @@ -204,7 +204,7 @@ _fedpkg() esac local all_options="--help $options" - local all_options_value="$options_target $options_arches $options_branch $options_string $options_file $options_dir $options_srpm $options_mroot" + local all_options_value="$options_target $options_arches $options_branch $options_string $options_file $options_dir $options_srpm $options_mroot $options_builder" # count non-option parameters @@ -234,6 +234,9 @@ _fedpkg() elif [[ -n $options_arches ]] && in_array "$last_option" "$options_arches"; then COMPREPLY=( $(compgen -W "$(_fedpkg_arch) $all_options" -- "$cur") ) + elif [[ -n $options_builder ]] && in_array "$prev" "$options_builder"; then + COMPREPLY=( $(compgen -W "$(_fedpkg_builder)" -- "$cur") ) + elif [[ -n $options_srpm ]] && in_array "$prev" "$options_srpm"; then _filedir_exclude_paths "*.src.rpm" @@ -291,6 +294,11 @@ _fedpkg_arch() echo "i386 i686 x86_64 armv5tel armv7hl armv7hnl ppc ppc64 ppc64p7 s390 s390x" } +_fedpkg_builder() +{ + echo "koji osbs" +} + _fedpkg_branch() { local git_options= format="--format %(refname:short)"