advanced command line completion for wwctl overlay

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2023-05-09 13:23:28 +02:00
committed by Christian Goll
parent 4d1711f46f
commit ff7608251a
4 changed files with 37 additions and 10 deletions

View File

@@ -46,3 +46,12 @@ func (config *NodeYaml) FindByIpaddr(ipaddr string) (NodeInfo, error) {
return ret, errors.New("No nodes found with IP Addr: " + ipaddr)
}
// Return just the node list as string slice
func (config *NodeYaml) NodeList() []string {
ret := make([]string, len(config.Nodes))
for key := range config.Nodes {
ret = append(ret, key)
}
return ret
}