mirror of
https://github.com/openziti/zrok.git
synced 2025-07-01 06:50:56 +02:00
'zrok agent' -> 'zrok agent start' (#463)
This commit is contained in:
@ -8,25 +8,25 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(newAgentCommand().cmd)
|
agentCmd.AddCommand(newAgentStartCommand().cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
type agentCommand struct {
|
type agentStartCommand struct {
|
||||||
cmd *cobra.Command
|
cmd *cobra.Command
|
||||||
}
|
}
|
||||||
|
|
||||||
func newAgentCommand() *agentCommand {
|
func newAgentStartCommand() *agentStartCommand {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "agent",
|
Use: "start",
|
||||||
Short: "Launch a zrok agent",
|
Short: "Launch a zrok agent",
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
}
|
}
|
||||||
command := &agentCommand{cmd: cmd}
|
command := &agentStartCommand{cmd: cmd}
|
||||||
cmd.Run = command.run
|
cmd.Run = command.run
|
||||||
return command
|
return command
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *agentCommand) run(_ *cobra.Command, _ []string) {
|
func (cmd *agentStartCommand) run(_ *cobra.Command, _ []string) {
|
||||||
root, err := environment.LoadRoot()
|
root, err := environment.LoadRoot()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tui.Error("error loading zrokdir", err)
|
tui.Error("error loading zrokdir", err)
|
||||||
|
@ -23,6 +23,7 @@ func init() {
|
|||||||
adminCmd.AddCommand(adminDeleteCmd)
|
adminCmd.AddCommand(adminDeleteCmd)
|
||||||
adminCmd.AddCommand(adminListCmd)
|
adminCmd.AddCommand(adminListCmd)
|
||||||
adminCmd.AddCommand(adminUpdateCmd)
|
adminCmd.AddCommand(adminUpdateCmd)
|
||||||
|
rootCmd.AddCommand(agentCmd)
|
||||||
testCmd.AddCommand(loopCmd)
|
testCmd.AddCommand(loopCmd)
|
||||||
rootCmd.AddCommand(adminCmd)
|
rootCmd.AddCommand(adminCmd)
|
||||||
rootCmd.AddCommand(configCmd)
|
rootCmd.AddCommand(configCmd)
|
||||||
@ -75,6 +76,12 @@ var adminUpdateCmd = &cobra.Command{
|
|||||||
Short: "Update global resources",
|
Short: "Update global resources",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var agentCmd = &cobra.Command{
|
||||||
|
Use: "agent",
|
||||||
|
Short: "zrok Agent commands",
|
||||||
|
Aliases: []string{"daemon"},
|
||||||
|
}
|
||||||
|
|
||||||
var configCmd = &cobra.Command{
|
var configCmd = &cobra.Command{
|
||||||
Use: "config",
|
Use: "config",
|
||||||
Short: "Configure your zrok environment",
|
Short: "Configure your zrok environment",
|
||||||
|
Reference in New Issue
Block a user