Skip to content

Commit

Permalink
'zrok agent' -> 'zrok agent start' (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Aug 23, 2024
1 parent 95098e6 commit 3c310c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/zrok/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions cmd/zrok/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 3c310c2

Please sign in to comment.