cmd/services: add named arguments.

This improves the generated completions.

Co-authored-by: Eric Knibbe <enk3@outlook.com>
This commit is contained in:
Mike McQuaid 2025-03-28 08:49:26 +00:00
parent 11426c9680
commit f54b4183a0
No known key found for this signature in database
4 changed files with 13 additions and 2 deletions

View File

@ -60,7 +60,7 @@ module Homebrew
switch "--no-wait", description: "Don't wait for `stop` to finish stopping the service."
switch "--keep", description: "When stopped, don't unregister the service from launching at login (or boot)."
conflicts "--max-wait=", "--no-wait"
named_args
named_args %w[list info run start stop kill restart cleanup]
end
sig { override.void }

View File

@ -2346,6 +2346,7 @@ _brew_services() {
;;
*) ;;
esac
__brewcomp "list info run start stop kill restart cleanup"
}
_brew_setup_ruby() {

View File

@ -1538,6 +1538,14 @@ __fish_brew_complete_arg 'search' -l verbose -d 'Make some output more verbose'
__fish_brew_complete_cmd 'services' 'Manage background services with macOS\' `launchctl`(1) daemon manager or Linux\'s `systemctl`(1) service manager'
__fish_brew_complete_sub_cmd 'services' 'list'
__fish_brew_complete_sub_cmd 'services' 'info'
__fish_brew_complete_sub_cmd 'services' 'run'
__fish_brew_complete_sub_cmd 'services' 'start'
__fish_brew_complete_sub_cmd 'services' 'stop'
__fish_brew_complete_sub_cmd 'services' 'kill'
__fish_brew_complete_sub_cmd 'services' 'restart'
__fish_brew_complete_sub_cmd 'services' 'cleanup'
__fish_brew_complete_arg 'services' -l all -d 'Run subcommand on all services'
__fish_brew_complete_arg 'services' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'services' -l file -d 'Use the service file from this location to `start` the service'

View File

@ -1902,7 +1902,9 @@ _brew_services() {
'(--max-wait)--no-wait[Don'\''t wait for `stop` to finish stopping the service]' \
'--quiet[Make some output more quiet]' \
'--sudo-service-user[When run as root on macOS, run the service(s) as this user]' \
'--verbose[Make some output more verbose]'
'--verbose[Make some output more verbose]' \
- subcommand \
'*::subcommand:(list info run start stop kill restart cleanup)'
}
# brew setup-ruby