mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-29 21:27:05 +02:00
service auth, edit and delete now all support --service flag
If a service name is given, this will be used. If not the user is prompted to select one.
This commit is contained in:
parent
c21715d36b
commit
9449a29fb1
9 changed files with 29 additions and 51 deletions
|
@ -116,13 +116,13 @@ func AllServicesAsList() ServiceList {
|
|||
return list
|
||||
}
|
||||
|
||||
func GetService(name string) (*ServiceConfig, error) {
|
||||
func GetService(name string) (ServiceConfig, error) {
|
||||
key := "service." + name
|
||||
config := viper.Sub(key)
|
||||
if config != nil {
|
||||
service := NewServiceConfig(name, config)
|
||||
return &service, nil
|
||||
return service, nil
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf(i18n.Tr("no service configuration \"%v\"", name))
|
||||
return ServiceConfig{}, fmt.Errorf(i18n.Tr("no service configuration \"%v\"", name))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue