Move the CLI functiontionality to the CLI package
This commit is contained in:
parent
8f67bdba8c
commit
77e5255fdd
7 changed files with 340 additions and 291 deletions
25
cmd/headscale/cli/server.go
Normal file
25
cmd/headscale/cli/server.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package cli
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var ServeCmd = &cobra.Command{
|
||||
Use: "serve",
|
||||
Short: "Launches the headscale server",
|
||||
Args: func(cmd *cobra.Command, args []string) error {
|
||||
return nil
|
||||
},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
h, err := getHeadscaleApp()
|
||||
if err != nil {
|
||||
log.Fatalf("Error initializing: %s", err)
|
||||
}
|
||||
err = h.Serve()
|
||||
if err != nil {
|
||||
log.Fatalf("Error initializing: %s", err)
|
||||
}
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue