From 93f48c32c42cab00bdfb9ad575849aa26a640b10 Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Wed, 17 May 2023 14:50:53 +0000 Subject: [PATCH] doc --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5be5598..1bfefff 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 -- GitLab