An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

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.

Ecosystem
proxy.golang.org
Latest Release
v0.0.0-20190621165703-3eeede183fe6
over 6 years ago
Versions
1
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/artyom/usagegen
spec
License MIT
Namespace github.com/artyom
First Release over 6 years ago
Last Synced 15 days ago
Repository
Stars 0 on GitHub
Forks 0 on GitHub
Rankings on proxy.golang.org
Overall Top 8.2%