diff options
author | Robin Jarry <robin@jarry.cc> | 2024-10-12 00:21:46 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-10-23 10:22:51 +0200 |
commit | d0484b153aa5fa80c415f4025aef493eba167e12 (patch) | |
tree | 663b4d52d6f7e070477963346e3e3699eca8c384 /commands/patch | |
parent | 26033eaecfe6733b2f911dea283433df11773256 (diff) | |
download | aerc-d0484b153aa5fa80c415f4025aef493eba167e12.tar.gz |
completion: add command option descriptions
Add `desc:""` struct field tags in all command arguments where it makes
sense.
The description values will be returned along with completion choices.
Implements: https://todo.sr.ht/~rjarry/aerc/271
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bojan Gabric <bojan@bojangabric.com>
Tested-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'commands/patch')
-rw-r--r-- | commands/patch/apply.go | 6 | ||||
-rw-r--r-- | commands/patch/drop.go | 2 | ||||
-rw-r--r-- | commands/patch/find.go | 4 | ||||
-rw-r--r-- | commands/patch/init.go | 2 | ||||
-rw-r--r-- | commands/patch/list.go | 2 | ||||
-rw-r--r-- | commands/patch/patch.go | 2 | ||||
-rw-r--r-- | commands/patch/switch.go | 2 | ||||
-rw-r--r-- | commands/patch/unlink.go | 2 |
8 files changed, 11 insertions, 11 deletions
diff --git a/commands/patch/apply.go b/commands/patch/apply.go index 12f5b3f8..31ca6964 100644 --- a/commands/patch/apply.go +++ b/commands/patch/apply.go @@ -15,9 +15,9 @@ import ( ) type Apply struct { - Cmd string `opt:"-c"` - Worktree string `opt:"-w"` - Tag string `opt:"tag" required:"true" complete:"CompleteTag"` + Cmd string `opt:"-c" desc:"Apply patches with provided command."` + Worktree string `opt:"-w" desc:"Create linked worktree on this <commit-ish>."` + Tag string `opt:"tag" required:"true" complete:"CompleteTag" desc:"Identify patches with tag."` } func init() { diff --git a/commands/patch/drop.go b/commands/patch/drop.go index dbb1fb07..89d574f1 100644 --- a/commands/patch/drop.go +++ b/commands/patch/drop.go @@ -11,7 +11,7 @@ import ( ) type Drop struct { - Tag string `opt:"tag" complete:"CompleteTag"` + Tag string `opt:"tag" complete:"CompleteTag" desc:"Repository patch tag."` } func init() { diff --git a/commands/patch/find.go b/commands/patch/find.go index a74f926e..ab5252c4 100644 --- a/commands/patch/find.go +++ b/commands/patch/find.go @@ -15,8 +15,8 @@ import ( ) type Find struct { - Filter bool `opt:"-f"` - Commit []string `opt:"..." required:"true" complete:"Complete"` + Filter bool `opt:"-f" desc:"Filter message list instead of search."` + Commit []string `opt:"..." required:"true" complete:"Complete" desc:"Search for <commit-ish>."` } func init() { diff --git a/commands/patch/init.go b/commands/patch/init.go index b7316ee4..7640f268 100644 --- a/commands/patch/init.go +++ b/commands/patch/init.go @@ -10,7 +10,7 @@ import ( ) type Init struct { - Force bool `opt:"-f"` + Force bool `opt:"-f" desc:"Overwrite any existing project."` Name string `opt:"name" required:"false"` } diff --git a/commands/patch/list.go b/commands/patch/list.go index a9c68e4d..f4a1e5e9 100644 --- a/commands/patch/list.go +++ b/commands/patch/list.go @@ -18,7 +18,7 @@ import ( ) type List struct { - All bool `opt:"-a"` + All bool `opt:"-a" desc:"List all projects."` } func init() { diff --git a/commands/patch/patch.go b/commands/patch/patch.go index 0e19d888..8e280398 100644 --- a/commands/patch/patch.go +++ b/commands/patch/patch.go @@ -23,7 +23,7 @@ func register(cmd commands.Command) { } type Patch struct { - SubCmd commands.Command `opt:"command" action:"ParseSub" complete:"CompleteSubNames"` + SubCmd commands.Command `opt:"command" action:"ParseSub" complete:"CompleteSubNames" desc:"Sub command."` Args string `opt:"..." required:"false" complete:"CompleteSubArgs"` } diff --git a/commands/patch/switch.go b/commands/patch/switch.go index 9eb26ef2..3eea1268 100644 --- a/commands/patch/switch.go +++ b/commands/patch/switch.go @@ -11,7 +11,7 @@ import ( ) type Switch struct { - Project string `opt:"project" complete:"Complete"` + Project string `opt:"project" complete:"Complete" desc:"Project name."` } func init() { diff --git a/commands/patch/unlink.go b/commands/patch/unlink.go index da21c15e..5c47d89f 100644 --- a/commands/patch/unlink.go +++ b/commands/patch/unlink.go @@ -11,7 +11,7 @@ import ( ) type Unlink struct { - Tag string `opt:"tag" required:"false" complete:"Complete"` + Tag string `opt:"tag" required:"false" complete:"Complete" desc:"Project tag name."` } func init() { |