From caff943a3d0aa14d1e47977439a6eaef9b437773 Mon Sep 17 00:00:00 2001 From: sjmiller609 <7516283+sjmiller609@users.noreply.github.com> Date: Thu, 2 Apr 2026 20:10:58 +0000 Subject: [PATCH] Add singular/plural aliases to resource commands Allow both singular and plural forms for all resource commands (e.g. "hypeman images" works as alias for "hypeman image"). Subcommands inherit the alias automatically via urfave/cli. Commands updated: - image/images - volume/volumes - snapshot/snapshots - device/devices - ingress/ingresses - build/builds - resources/resource Co-Authored-By: Claude Opus 4.6 --- pkg/cmd/build.go | 1 + pkg/cmd/devicecmd.go | 5 +++-- pkg/cmd/imagecmd.go | 5 +++-- pkg/cmd/ingresscmd.go | 5 +++-- pkg/cmd/resourcecmd.go | 5 +++-- pkg/cmd/snapshotcmd.go | 5 +++-- pkg/cmd/volumecmd.go | 5 +++-- 7 files changed, 19 insertions(+), 12 deletions(-) diff --git a/pkg/cmd/build.go b/pkg/cmd/build.go index bb8947b..9599fc3 100644 --- a/pkg/cmd/build.go +++ b/pkg/cmd/build.go @@ -18,6 +18,7 @@ import ( var buildCmd = cli.Command{ Name: "build", + Aliases: []string{"builds"}, Usage: "Build an image from a Dockerfile", ArgsUsage: "[path]", Description: `Build an image from a Dockerfile and source context. diff --git a/pkg/cmd/devicecmd.go b/pkg/cmd/devicecmd.go index 338ce9f..ac5fb39 100644 --- a/pkg/cmd/devicecmd.go +++ b/pkg/cmd/devicecmd.go @@ -12,8 +12,9 @@ import ( ) var deviceCmd = cli.Command{ - Name: "device", - Usage: "Manage PCI/GPU devices for passthrough", + Name: "device", + Aliases: []string{"devices"}, + Usage: "Manage PCI/GPU devices for passthrough", Description: `Manage PCI devices for passthrough to virtual machines. This command allows you to discover available passthrough-capable devices, diff --git a/pkg/cmd/imagecmd.go b/pkg/cmd/imagecmd.go index cda0eaa..5c86df4 100644 --- a/pkg/cmd/imagecmd.go +++ b/pkg/cmd/imagecmd.go @@ -13,8 +13,9 @@ import ( ) var imageCmd = cli.Command{ - Name: "image", - Usage: "Manage images", + Name: "image", + Aliases: []string{"images"}, + Usage: "Manage images", Commands: []*cli.Command{ &imageCreateCmd, &imageListCmd, diff --git a/pkg/cmd/ingresscmd.go b/pkg/cmd/ingresscmd.go index bec07a2..b61dca2 100644 --- a/pkg/cmd/ingresscmd.go +++ b/pkg/cmd/ingresscmd.go @@ -13,8 +13,9 @@ import ( ) var ingressCmd = cli.Command{ - Name: "ingress", - Usage: "Manage ingresses", + Name: "ingress", + Aliases: []string{"ingresses"}, + Usage: "Manage ingresses", Commands: []*cli.Command{ &ingressCreateCmd, &ingressListCmd, diff --git a/pkg/cmd/resourcecmd.go b/pkg/cmd/resourcecmd.go index 8d69018..b42b7a0 100644 --- a/pkg/cmd/resourcecmd.go +++ b/pkg/cmd/resourcecmd.go @@ -15,8 +15,9 @@ import ( ) var resourcesCmd = cli.Command{ - Name: "resources", - Usage: "Show server resource capacity and allocation status", + Name: "resources", + Aliases: []string{"resource"}, + Usage: "Show server resource capacity and allocation status", Description: `Display current host resource capacity, allocation status, and per-instance breakdown. Resources include CPU, memory, disk, network, and GPU (if available). diff --git a/pkg/cmd/snapshotcmd.go b/pkg/cmd/snapshotcmd.go index c6634d5..29931c3 100644 --- a/pkg/cmd/snapshotcmd.go +++ b/pkg/cmd/snapshotcmd.go @@ -14,8 +14,9 @@ import ( ) var snapshotCmd = cli.Command{ - Name: "snapshot", - Usage: "Manage instance snapshots", + Name: "snapshot", + Aliases: []string{"snapshots"}, + Usage: "Manage instance snapshots", Commands: []*cli.Command{ &snapshotCreateCmd, &snapshotRestoreCmd, diff --git a/pkg/cmd/volumecmd.go b/pkg/cmd/volumecmd.go index 3445b17..43dcea2 100644 --- a/pkg/cmd/volumecmd.go +++ b/pkg/cmd/volumecmd.go @@ -12,8 +12,9 @@ import ( ) var volumeCmd = cli.Command{ - Name: "volume", - Usage: "Manage volumes", + Name: "volume", + Aliases: []string{"volumes"}, + Usage: "Manage volumes", Commands: []*cli.Command{ &volumeCreateCmd, &volumeListCmd,