From 479204cb428b4586efda1d42d8562850caba02e7 Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 26 Nov 2025 13:13:00 -0500 Subject: [PATCH] adding subcommand aliases --- cmd/command/add.go | 1 + cmd/command/command.go | 1 + cmd/command/view.go | 1 + cmd/root.go | 2 +- cmd/run.go | 1 + cmd/server/add.go | 1 + cmd/server/server.go | 1 + cmd/server/update.go | 1 + cmd/server/view.go | 1 + 9 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/command/add.go b/cmd/command/add.go index 594f4bc..0f6cf2c 100644 --- a/cmd/command/add.go +++ b/cmd/command/add.go @@ -15,6 +15,7 @@ import ( var addCmd = &cobra.Command{ Use: "add", + Aliases: []string{"a"}, Example: "mctl command add", Short: "Saves a new command to the database", SilenceUsage: true, diff --git a/cmd/command/command.go b/cmd/command/command.go index 600466b..f1d6895 100644 --- a/cmd/command/command.go +++ b/cmd/command/command.go @@ -10,6 +10,7 @@ import ( // CommandCmd is such a cool name lol var CommandCmd = &cobra.Command{ Use: "command", + Aliases: []string{"c"}, Example: "mctl command ", } diff --git a/cmd/command/view.go b/cmd/command/view.go index 851ec21..9b2bc13 100644 --- a/cmd/command/view.go +++ b/cmd/command/view.go @@ -13,6 +13,7 @@ import ( var viewCmd = &cobra.Command{ Use: "view", + Aliases: []string{"v"}, Example: "mctl command view", Short: "view all saved commands", SilenceUsage: true, diff --git a/cmd/root.go b/cmd/root.go index cf9f827..72e7fb5 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -16,7 +16,7 @@ var rootCmd = &cobra.Command{ Use: "mctl", Short: "A remote console client", Long: `mctl is a terminal-friendly remote console client made to manage game servers.`, - Version: "v0.5.1", + Version: "v0.7.1", } // Execute adds all child commands to the root command and sets flags appropriately. diff --git a/cmd/run.go b/cmd/run.go index 636441f..09b1b02 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -20,6 +20,7 @@ var ( var runCmd = &cobra.Command{ Use: "run", + Aliases: []string{"r"}, Example: "mctl run -s args...", Short: "Runs a saved command on a server", Long: `Runs the named command with the provided args on the default/active server unless -s is specified`, diff --git a/cmd/server/add.go b/cmd/server/add.go index 51074bd..184f43e 100644 --- a/cmd/server/add.go +++ b/cmd/server/add.go @@ -18,6 +18,7 @@ import ( var addCmd = &cobra.Command{ Use: "add", + Aliases: []string{"a"}, Example: "mctl server add", Short: "Saves a new server configuration", Long: `Saves server address, alias, port, and password to the database.`, diff --git a/cmd/server/server.go b/cmd/server/server.go index cfc9f73..2aa7977 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -16,6 +16,7 @@ const ( var ServerCmd = &cobra.Command{ Use: "server", + Aliases: []string{"s"}, Example: "mctl server ", } diff --git a/cmd/server/update.go b/cmd/server/update.go index c344edd..e10d7e9 100644 --- a/cmd/server/update.go +++ b/cmd/server/update.go @@ -16,6 +16,7 @@ import ( var updateCmd = &cobra.Command{ Use: "update", + Aliases: []string{"u"}, Example: "mctl server update ", Short: "updates a saved servers password in the database", SilenceUsage: true, diff --git a/cmd/server/view.go b/cmd/server/view.go index 39584d7..931f6d3 100644 --- a/cmd/server/view.go +++ b/cmd/server/view.go @@ -15,6 +15,7 @@ var decode bool var viewCmd = &cobra.Command{ Use: "view", + Aliases: []string{"v"}, Example: "mctl server view", Short: "view all saved servers", SilenceUsage: true,