Skip to content

Commit

Permalink
macro: fix signature
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed May 6, 2022
1 parent a70de34 commit 8d2462a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion cmd/carapace/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ var rootCmd = &cobra.Command{
case "--macros":
sortedMacros := make([]string, 0, len(macros))
for name, m := range macros {
sortedMacros = append(sortedMacros, fmt.Sprintf("$_%v(%v)", name, m.Signature()))
if signature := m.Signature(); signature == "" {
sortedMacros = append(sortedMacros, fmt.Sprintf("$_%v", name))
} else {
sortedMacros = append(sortedMacros, fmt.Sprintf("$_%v(%v)", name, m.Signature()))
}
}
sort.Strings(sortedMacros)
fmt.Fprintln(cmd.OutOrStdout(), strings.Join(sortedMacros, "\n"))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/mitchellh/go-ps v1.0.0
github.com/pelletier/go-toml v1.9.5
github.com/rsteube/carapace v0.20.2
github.com/rsteube/carapace-spec v0.0.11
github.com/rsteube/carapace-spec v0.0.12
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rsteube/carapace v0.20.2 h1:i6QSQZ5vZKmXcwupsYch8XdJ/GBbZU+H8XtfXEs8Z4E=
github.com/rsteube/carapace v0.20.2/go.mod h1:GgiwpPVhucHNOv0AmtIkxhiEFkCMP5BBRauyQLP0mFY=
github.com/rsteube/carapace-spec v0.0.11 h1:RLPwgj3GkkVm99o6uWz2SidLDMAvdLmMp5nq83obtR0=
github.com/rsteube/carapace-spec v0.0.11/go.mod h1:vyKkMfbIYHhPiUeyCemLWh96XNPwWI9B6Go0+W5nDUw=
github.com/rsteube/carapace-spec v0.0.12 h1:1CMQgfOziMtV9v2asPeIe3U2WSqjUXmNkyJrVi5KC/w=
github.com/rsteube/carapace-spec v0.0.12/go.mod h1:vyKkMfbIYHhPiUeyCemLWh96XNPwWI9B6Go0+W5nDUw=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
Expand Down

0 comments on commit 8d2462a

Please sign in to comment.