proxy.golang.org : github.com/creachadair/vocab
Package vocab handles flag parsing and dispatch for a nested language of commands and subcommands. In this model, a command-line is treated as a phrase in a simple grammar: Each name may be either a command in itself, or a group of subcommands with a shared set of flags, or both. You describe command vocabulary with nested struct values, whose fields define flags and subcommands to be executed. The implementation of a command is provided by by implementing the vocab.Runner interface. Commands may pass shared state to their subcommands by attaching it to a context value that is propagated down the vocabulary tree. Basic usage outline:
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/creachadair/vocab
License: MIT
Latest release: over 6 years ago
First release: over 6 years ago
Namespace: github.com/creachadair
Last synced: 15 days ago