proxy.golang.org : github.com/artyom/usagegen
Command usagegen reads "main" package godoc and creates source file that defines constant holding extracted text. It is intended to be used by command line tools that print package documentation as part of their usage help, for example, when invoked with -h flag. When run in a directory holding main package source, it extracts its documentation and creates automatically generated file (usage_generated.go by default) that defines single constant named "usage". This constant can then be used in code like this: If program uses flag package, then when run with -h flag it will output godoc text followed by list of supported flags as printed by flag.PrintDefaults. If usagegen is called with -autohelp flag, it generates source file that defines single init() function that sets flag.Usage variable as in above example, but usage constant instead only scoped to this init function. It can be used with go generate by including this line somewhere in main package source: Then whenever package documentation is updated, run "go generate" to regenerate source file with usage text.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/artyom/usagegen
License: MIT
Latest release: about 6 years ago
First release: about 6 years ago
Namespace: github.com/artyom
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 18 days ago