mirror of
https://github.com/zrepl/zrepl.git
synced 2025-06-19 08:16:38 +02:00
cmd: test: would always run testCmdGlobalInit
This commit is contained in:
parent
9cd83399d3
commit
1a62d635a6
@ -16,8 +16,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var testCmd = &cobra.Command{
|
var testCmd = &cobra.Command{
|
||||||
Use: "test",
|
Use: "test",
|
||||||
Short: "test configuration",
|
Short: "test configuration",
|
||||||
|
PersistentPreRun: testCmdGlobalInit,
|
||||||
}
|
}
|
||||||
|
|
||||||
var testCmdGlobal struct {
|
var testCmdGlobal struct {
|
||||||
@ -51,7 +52,6 @@ var testPrunePolicyCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cobra.OnInitialize(testCmdGlobalInit)
|
|
||||||
RootCmd.AddCommand(testCmd)
|
RootCmd.AddCommand(testCmd)
|
||||||
testCmd.AddCommand(testConfigSyntaxCmd)
|
testCmd.AddCommand(testConfigSyntaxCmd)
|
||||||
testCmd.AddCommand(testDatasetMapFilter)
|
testCmd.AddCommand(testDatasetMapFilter)
|
||||||
@ -62,7 +62,7 @@ func init() {
|
|||||||
testCmd.AddCommand(testPrunePolicyCmd)
|
testCmd.AddCommand(testPrunePolicyCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testCmdGlobalInit() {
|
func testCmdGlobalInit(cmd *cobra.Command, args []string) {
|
||||||
|
|
||||||
testCmdGlobal.log = log.New(os.Stdout, "", 0)
|
testCmdGlobal.log = log.New(os.Stdout, "", 0)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user