Update README for stub flag

This commit is contained in:
Suhas Karanth 2020-08-16 12:29:28 +05:30
parent 83ab8dd79f
commit e3d1bd8a7e
2 changed files with 3 additions and 1 deletions

View File

@ -31,6 +31,8 @@ moq [flags] source-dir interface [interface2 [interface3 [...]]]
output file (default stdout) output file (default stdout)
-pkg string -pkg string
package name (default will infer) package name (default will infer)
-stub
return zero values when no mock implementation is provided, do not panic
Specifying an alias for the mock is also supported with the format 'interface:alias' Specifying an alias for the mock is also supported with the format 'interface:alias'
Ex: moq -pkg different . MyInterface:MyMock Ex: moq -pkg different . MyInterface:MyMock
``` ```

View File

@ -26,7 +26,7 @@ func main() {
flag.StringVar(&flags.outFile, "out", "", "output file (default stdout)") flag.StringVar(&flags.outFile, "out", "", "output file (default stdout)")
flag.StringVar(&flags.pkgName, "pkg", "", "package name (default will infer)") flag.StringVar(&flags.pkgName, "pkg", "", "package name (default will infer)")
flag.StringVar(&flags.formatter, "fmt", "", "go pretty-printer: gofmt (default) or goimports") flag.StringVar(&flags.formatter, "fmt", "", "go pretty-printer: gofmt (default) or goimports")
flag.BoolVar(&flags.stubImpl, "stubImpl", false, flag.BoolVar(&flags.stubImpl, "stub", false,
"return zero values when no mock implementation is provided, do not panic") "return zero values when no mock implementation is provided, do not panic")
flag.Usage = func() { flag.Usage = func() {