'zrok agent' -> 'zrok agent start' (#463)

This commit is contained in:
Michael Quigley 2024-08-23 12:12:57 -04:00
parent 95098e6357
commit 3c310c27db
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 13 additions and 6 deletions

View File

@ -8,25 +8,25 @@ import (
)
func init() {
rootCmd.AddCommand(newAgentCommand().cmd)
agentCmd.AddCommand(newAgentStartCommand().cmd)
}
type agentCommand struct {
type agentStartCommand struct {
cmd *cobra.Command
}
func newAgentCommand() *agentCommand {
func newAgentStartCommand() *agentStartCommand {
cmd := &cobra.Command{
Use: "agent",
Use: "start",
Short: "Launch a zrok agent",
Args: cobra.NoArgs,
}
command := &agentCommand{cmd: cmd}
command := &agentStartCommand{cmd: cmd}
cmd.Run = command.run
return command
}
func (cmd *agentCommand) run(_ *cobra.Command, _ []string) {
func (cmd *agentStartCommand) run(_ *cobra.Command, _ []string) {
root, err := environment.LoadRoot()
if err != nil {
tui.Error("error loading zrokdir", err)

View File

@ -23,6 +23,7 @@ func init() {
adminCmd.AddCommand(adminDeleteCmd)
adminCmd.AddCommand(adminListCmd)
adminCmd.AddCommand(adminUpdateCmd)
rootCmd.AddCommand(agentCmd)
testCmd.AddCommand(loopCmd)
rootCmd.AddCommand(adminCmd)
rootCmd.AddCommand(configCmd)
@ -75,6 +76,12 @@ var adminUpdateCmd = &cobra.Command{
Short: "Update global resources",
}
var agentCmd = &cobra.Command{
Use: "agent",
Short: "zrok Agent commands",
Aliases: []string{"daemon"},
}
var configCmd = &cobra.Command{
Use: "config",
Short: "Configure your zrok environment",