Add "configtest" CLI command. (#1230)

Co-authored-by: Kristoffer Dalby <kristoffer@dalby.cc>
Fixes https://github.com/juanfont/headscale/issues/1229
This commit is contained in:
Sean Reifschneider 2023-03-03 06:55:29 -07:00 committed by GitHub
parent 2baeb79aa0
commit f49930c514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View file

@ -4,6 +4,8 @@
### changes
- Adding "configtest" CLI command.
## 0.20.0 (2023-02-03)
### changes

View file

@ -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")
}
},
}