Skip to content

Commit

Permalink
Add zsh completion for build command
Browse files Browse the repository at this point in the history
Signed-off-by: Björn Bidar <[email protected]>
  • Loading branch information
Thaodan committed Sep 8, 2023
1 parent 513fd36 commit a1396e6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions contrib/osc.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ _osc() {
case $cmd in
submitrequest|submitreq|sr) _osc_cmd_submitreq ;;
getbinaries) _osc_cmd_getbinaries ;;
build) _osc_cmd_build ;;
checkout|co|branch|getpac|bco|branchco) _osc_cmd_checkout ;;
buildlog|buildinfo|bl|blt|buildlogtail) _osc_cmd_buildlog ;;
*) _osc_cmd_do $cmd
Expand Down Expand Up @@ -218,6 +219,22 @@ _osc_cmd_buildlog() {
fi
}

_osc_cmd_build() {
if [ "$words[2]" = "-" ]; then
_osc_complete_help_commands 'options' 'option'
return
else
if [ -n "$words[2]" ] ; then
local osc_project_repository_arch=$(_osc_project_repositories_arches \
"${words[2]}")
fi
_arguments \
'1:REPOSITORY:( `_osc_project_repositories` )' \
'2:ARCHITECTURE:(`echo $osc_project_repository_arch`)' \
'3:Build Description:_files'
fi
}

_osc_cmd_submitreq() {
_osc_complete_help_commands 'options' 'option'
}
Expand Down

0 comments on commit a1396e6

Please sign in to comment.