MCPcopy Create free account
hub / github.com/beringresearch/macpine / ListVMNames

Function ListVMNames

host/utils.go:13–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11)
12
13func ListVMNames() []string {
14 var vmList []string
15
16 userHomeDir, err := os.UserHomeDir()
17 if err != nil {
18 return vmList
19 }
20
21 dirList, err := os.ReadDir(filepath.Join(userHomeDir, ".macpine"))
22 if err != nil {
23 return vmList
24 }
25
26 for _, f := range dirList {
27 if f.IsDir() {
28 if f.Name() != "cache" {
29 vmList = append(vmList, f.Name())
30 }
31 }
32 }
33
34 return vmList
35}
36
37// autocomplete with VM Names
38func AutoCompleteVMNames(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {

Callers 15

stopFunction · 0.92
renameFunction · 0.92
startFunction · 0.92
resumeFunction · 0.92
restartFunction · 0.92
deleteFunction · 0.92
execFunction · 0.92
shellFunction · 0.92
launchFunction · 0.92
macpineInfoFunction · 0.92
editFunction · 0.92
pauseFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected