feat(images): 'uc image ls' and 'uc images' (alias) commands to list images on machines

This commit is contained in:
Pasha Sviderski
2025-10-03 20:53:30 +10:00
parent cce81ecaad
commit 6d2e100d63
6 changed files with 197 additions and 9 deletions
+19
View File
@@ -0,0 +1,19 @@
package main
import (
"strings"
"github.com/psviderski/uncloud/cmd/uncloud/image"
"github.com/spf13/cobra"
)
// NewImagesCommand returns the 'image ls' command modified to work as 'images'.
func NewImagesCommand() *cobra.Command {
listCmd := image.NewListCommand()
listCmd.Use = "images"
// Remove 'list' alias since this command is already an alias.
listCmd.Aliases = nil
listCmd.Example = strings.ReplaceAll(listCmd.Example, "uc image ls", "uc images")
return listCmd
}