@@ 9,7 9,7 @@ import (
)
type CompleteStruct struct {
- Name string `opt:"-n,--name" required:"true" complete:"CompleteName"`
+ Name string `opt:"-n,--name" required:"true" complete:"CompleteName" desc:"Ninja turtle name."`
Delay float64 `opt:"--delay"`
Zero bool `opt:"-z" description:"Print zero values"`
Backoff bool `opt:"-B,--backoff" desc:"Increase delay on error"`
@@ 52,42 52,42 @@ func TestComplete(t *testing.T) {
}{
{
"foo --delay 33..33.3 -n",
- []opt.Completion{{Value: "-n "}},
+ []opt.Completion{{Value: "-n ", Description: "Ninja turtle name."}},
"foo --delay 33..33.3 ",
},
{
"foo --delay 33..33.3 -n ",
[]opt.Completion{
- {Value: "leonardo"},
- {Value: "michelangelo"},
- {Value: "rafaelo"},
- {Value: "donatello"},
+ {Value: "leonardo", Description: "Ninja turtle name."},
+ {Value: "michelangelo", Description: "Ninja turtle name."},
+ {Value: "rafaelo", Description: "Ninja turtle name."},
+ {Value: "donatello", Description: "Ninja turtle name."},
},
"foo --delay 33..33.3 -n ",
},
{
"foo --delay 33..33.3 -n don",
- []opt.Completion{{Value: "donatello"}},
+ []opt.Completion{{Value: "donatello", Description: "Ninja turtle name."}},
"foo --delay 33..33.3 -n ",
},
{
"foo --delay 33..33.3 --name=",
[]opt.Completion{
- {Value: "leonardo"},
- {Value: "michelangelo"},
- {Value: "rafaelo"},
- {Value: "donatello"},
+ {Value: "leonardo", Description: "Ninja turtle name."},
+ {Value: "michelangelo", Description: "Ninja turtle name."},
+ {Value: "rafaelo", Description: "Ninja turtle name."},
+ {Value: "donatello", Description: "Ninja turtle name."},
},
"foo --delay 33..33.3 --name=",
},
{
"foo --delay 33..33.3 --name=leo",
- []opt.Completion{{Value: "leonardo"}},
+ []opt.Completion{{Value: "leonardo", Description: "Ninja turtle name."}},
"foo --delay 33..33.3 --name=",
},
{
"foo --nam",
- []opt.Completion{{Value: "--name "}},
+ []opt.Completion{{Value: "--name ", Description: "Ninja turtle name."}},
"foo ",
},
{
@@ 103,8 103,8 @@ func TestComplete(t *testing.T) {
{Value: "-important"},
{Value: "-inbox"},
{Value: "-trash"},
- {Value: "-n "},
- {Value: "--name "},
+ {Value: "-n ", Description: "Ninja turtle name."},
+ {Value: "--name ", Description: "Ninja turtle name."},
{Value: "-z ", Description: "Print zero values"},
{Value: "-B ", Description: "Increase delay on error"},
{Value: "--backoff ", Description: "Increase delay on error"},
@@ 119,8 119,8 @@ func TestComplete(t *testing.T) {
{Value: "important"},
{Value: "inbox"},
{Value: "trash"},
- {Value: "-n "},
- {Value: "--name "},
+ {Value: "-n ", Description: "Ninja turtle name."},
+ {Value: "--name ", Description: "Ninja turtle name."},
{Value: "-z ", Description: "Print zero values"},
{Value: "-B ", Description: "Increase delay on error"},
{Value: "--backoff ", Description: "Increase delay on error"},