From c3a019cdb8116ae3b4a928c2a14efd83df7f34aa Mon Sep 17 00:00:00 2001 From: Andrew Morozko Date: Sat, 30 Nov 2019 00:22:21 +0300 Subject: Various changes --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 1f02559..ae0c567 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,32 @@ var args struct { arg.MustParse(&args) ``` +### Custom placeholders + +```go +var args struct { + Input string `arg:"positional" placeholder:"SRC"` + Output []string `arg:"positional" placeholder:"DST"` + Optimize int `arg:"-O" help:"optimization level" placeholder:"LEVEL"` + MaxJobs int `arg:"-j" help:"maximum number of simultaneous jobs" placeholder:"N"` +} +arg.MustParse(&args) +``` +```shell +$ ./example -h +Usage: example [--optimize LEVEL] [--maxjobs N] SRC [DST [DST ...]] + +Positional arguments: + SRC + DST + +Options: + --optimize LEVEL, -O LEVEL + optimization level + --maxjobs N, -j N maximum number of simultaneous jobs + --help, -h display this help and exit +``` + ### Default values (before v1.2) ```go -- cgit v1.2.3