aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-30 01:29:16 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-30 01:29:16 +0100
commitd126d337836e03c664467799abfbc81af9fd40dd (patch)
tree5612bb0f96834833429da4c8af10860ac48b0dc6 /README.md
parent2b4e159a2472ef78f52f8190552b64015e95c1c5 (diff)
Fix broken examplesv1.0.1
Diffstat (limited to 'README.md')
-rw-r--r--README.md20
1 files changed, 10 insertions, 10 deletions
diff --git a/README.md b/README.md
index f2916ba..b15aaf4 100644
--- a/README.md
+++ b/README.md
@@ -36,10 +36,10 @@ func main() {
usage()
}
- for _, opt := range opts {
- switch opt.Key {
+ for _, f := range flags {
+ switch f.Key {
case 'a':
- fmt.Println("-a given with argument", opt.Value)
+ fmt.Println("-a given with argument", f.Value)
case 'ß':
fmt.Println("-ß given")
case 'λ':
@@ -74,20 +74,20 @@ func usage() {
func main() {
flags, optind, err := opts.GetLong(os.Args, []opts.LongOpt{
- {Short: 'a', Long: "add", Arg: Required},
- {Short: 'ß', Long: "sheiße", Arg: None},
- {Short: 'λ', Long: "λεωνίδας", Arg: None},
- {Short: noShortFlag, Long: "no-short", Arg: None},
+ {Short: 'a', Long: "add", Arg: opts.Required},
+ {Short: 'ß', Long: "sheiße", Arg: opts.None},
+ {Short: 'λ', Long: "λεωνίδας", Arg: opts.None},
+ {Short: noShortFlag, Long: "no-short", Arg: opts.None},
})
if err != nil {
fmt.Fprintf(os.Stderr, "%s: %s\n", os.Args[0], err)
usage()
}
- for _, opt := range opts {
- switch opt.Key {
+ for _, f := range flags {
+ switch f.Key {
case 'a':
- fmt.Println("-a or --add given with argument", opt.Value)
+ fmt.Println("-a or --add given with argument", f.Value)
case 'ß':
fmt.Println("-ß or --sheiße given")
case 'λ':