Skip to content

Commit

Permalink
Add "configtest" CLI command. (#1230)
Browse files Browse the repository at this point in the history
Co-authored-by: Kristoffer Dalby <kristoffer@dalby.cc>
Fixes #1229
  • Loading branch information
linsomniac authored Mar 3, 2023
1 parent 2baeb79 commit f49930c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### changes

- Adding "configtest" CLI command.

## 0.20.0 (2023-02-03)

### changes
Expand Down
22 changes: 22 additions & 0 deletions cmd/headscale/cli/configtest.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cli

import (
"github.com/spf13/cobra"
"github.com/rs/zerolog/log"
)

func init() {
rootCmd.AddCommand(configTestCmd)
}

var configTestCmd = &cobra.Command{
Use: "configtest",
Short: "Test the configuration.",
Long: "Run a test of the configuration and exit.",
Run: func(cmd *cobra.Command, args []string) {
_, err := getHeadscaleApp()
if err != nil {
log.Fatal().Caller().Err(err).Msg("Error initializing")
}
},
}

0 comments on commit f49930c

Please sign in to comment.