Making prefix matching opt in.
This commit is contained in:
4
cobra.go
4
cobra.go
@ -27,6 +27,10 @@ import (
|
||||
|
||||
var initializers []func()
|
||||
|
||||
// automatic prefix matching can be a dangerous thing to automatically enable in CLI tools.
|
||||
// Set this to true to enable it
|
||||
var EnablePrefixMatching bool = false
|
||||
|
||||
func OnInitialize(y ...func()) {
|
||||
for _, x := range y {
|
||||
initializers = append(initializers, x)
|
||||
|
||||
Reference in New Issue
Block a user