mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-26 22:27:56 +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
|
@ -46,8 +46,8 @@ var serviceAddCmd = &cobra.Command{
|
|||
Label: i18n.Tr("Service name"),
|
||||
Default: backend,
|
||||
Validate: func(s string) error {
|
||||
srv, _ := config.GetService(s)
|
||||
if srv != nil {
|
||||
_, err := config.GetService(s)
|
||||
if err == nil {
|
||||
return errors.New(i18n.Tr("a service with this name already exists"))
|
||||
}
|
||||
return config.ValidateKey(s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue