diff --git a/README.md b/README.md index 5be5598fe6a3bbfa336cd7f0f17f60df7985d67d..1bfefff79921659f79ca0eafe6964903bf07b93d 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ The following tags are supported: The functions are called up with a receiver. The receiver is the configuration. The function must have the following signature: -`func (d *Definition) DoServe(s *setting[Definition])` +`func (d *Definition) <name> (s *setting[Definition])` Let's assume we have the above definition. The Property `Serve` contains the command `serve`. Furthermore, the command has the tag `call` with @@ -108,7 +108,13 @@ definition. A good choice for the name is the argument `os.Args[0]`. ```go -setting := New(os.Args[0], Definition{}) +// define instance +var instance *xflags.Settings[Definition] + +func Execute() { + instance := xflags.New(os.Args[0], Definition{}) + if instance.HasErrors() { + // ... ``` ### Parse