mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-12-24 11:51:13 +08:00
feat(alias): show avaliable alias name (#354)
This commit is contained in:
@@ -137,7 +137,13 @@ func ParseAndGet(localFile, remoteAddr string, aliasName string) ([]Config, erro
|
||||
return nil, err
|
||||
}
|
||||
if len(configs) == 0 {
|
||||
err = fmt.Errorf("failed to find any aliases for the name %s, please verify your configuration file %s", aliasName, path)
|
||||
var names []string
|
||||
for _, c := range list {
|
||||
if c.Name != "" {
|
||||
names = append(names, c.Name)
|
||||
}
|
||||
}
|
||||
err = fmt.Errorf("failed to find any aliases for the name: '%s', avaliable: [%s], please verify your configuration file %s", aliasName, strings.Join(names, ", "), path)
|
||||
return nil, err
|
||||
}
|
||||
return configs, nil
|
||||
|
||||
Reference in New Issue
Block a user