From b69a2e7533b437cc7e16c9654465b1347a66e262 Mon Sep 17 00:00:00 2001 From: Jean de Klerk Date: Fri, 6 Jul 2018 13:33:47 -0700 Subject: [PATCH] allow period at the start of a symbol When describing a service, InputType and OutputType symbols are presented as .Foo.Bar. However, when describing a type, .Foo.Bar is not accepted; it must be changed to Foo.Bar. This is both confusing and breaks copy paste ability. This commit addresses the problem by optionally allowing a period at the beginning of a symbol. Fixes #39. --- cmd/grpcurl/grpcurl.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/grpcurl/grpcurl.go b/cmd/grpcurl/grpcurl.go index 3edc317..c17eee6 100644 --- a/cmd/grpcurl/grpcurl.go +++ b/cmd/grpcurl/grpcurl.go @@ -369,6 +369,10 @@ func main() { symbols = svcs } for _, s := range symbols { + if s[0] == '.' { + s = s[1:] + } + dsc, err := descSource.FindSymbol(s) if err != nil { fail(err, "Failed to resolve symbol %q", s)