ficsit-cli-flake/cmd/installation/ls.go

29 lines
504 B
Go
Raw Normal View History

2022-06-08 20:56:32 +00:00
package installation
import (
"github.com/satisfactorymodding/ficsit-cli/cli"
"github.com/spf13/cobra"
)
func init() {
Cmd.AddCommand(lsCmd)
}
var lsCmd = &cobra.Command{
Use: "ls",
Short: "List all installations",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
global, err := cli.InitCLI()
if err != nil {
return err
}
for _, install := range global.Installations.Installations {
println(install.Path, "-", install.Profile)
}
return nil
},
}