### Install Duckopt v2 Source: https://github.com/crdx/duckopt/blob/main/README.md Use 'go get' to install the duckopt library version 2. ```sh go get crdx.org/duckopt/v2 ``` -------------------------------- ### Bind Command-Line Arguments in Go Source: https://github.com/crdx/duckopt/blob/main/README.md Example of using duckopt to bind command-line arguments to a Go struct. Ensure the usage string and struct tags match your command-line interface definition. ```go import ( "fmt" "crdx.org/duckopt/v2" ) func getUsage() string { return ` Usage: $0 [options] run Options: -v, --verbose Be verbose ` } type Opts struct { Command bool `docopt:"run"` Arg string `docopt:""` Verbose bool `docopt:"--verbose"` } func main() { opts := duckopt.MustBind[Opts](getUsage(), "$0") fmt.Printf("%+v\n", opts) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.