File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ func (b *Builder) buildMethodCommandCommon(descriptor protoreflect.MethodDescrip
27
27
options = & autocliv1.RpcCommandOptions {}
28
28
}
29
29
30
+ short := options .Short
31
+ if short == "" {
32
+ short = fmt .Sprintf ("Execute the %s RPC method" , descriptor .Name ())
33
+ }
34
+
30
35
long := options .Long
31
36
if long == "" {
32
37
long = util .DescriptorDocs (descriptor )
@@ -44,7 +49,7 @@ func (b *Builder) buildMethodCommandCommon(descriptor protoreflect.MethodDescrip
44
49
SilenceUsage : false ,
45
50
Use : use ,
46
51
Long : long ,
47
- Short : options . Short ,
52
+ Short : short ,
48
53
Example : options .Example ,
49
54
Aliases : options .Alias ,
50
55
SuggestFor : options .SuggestFor ,
Original file line number Diff line number Diff line change @@ -8,10 +8,13 @@ import (
8
8
"cosmossdk.io/client/v2/internal/strcase"
9
9
)
10
10
11
+ // DescriptorName returns the name of the descriptor in kebab case.
11
12
func DescriptorKebabName (descriptor protoreflect.Descriptor ) string {
12
13
return strcase .ToKebab (string (descriptor .Name ()))
13
14
}
14
15
16
+ // DescriptorDocs returns the leading comments of the descriptor.
17
+ // TODO this does not work, to fix.
15
18
func DescriptorDocs (descriptor protoreflect.Descriptor ) string {
16
19
return descriptor .ParentFile ().SourceLocations ().ByDescriptor (descriptor ).LeadingComments
17
20
}
You can’t perform that action at this time.
0 commit comments