Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
added support for plugin aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Jul 18, 2017
1 parent d4ea929 commit 5bbae31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions buffalo/cmd/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ func decorate(name string, cmd *cobra.Command) {
for _, c := range plugs()[name] {
func(c plugins.Command) {
cc := &cobra.Command{
Use: c.Name,
Short: fmt.Sprintf("[PLUGIN] %s", c.Description),
Use: c.Name,
Short: fmt.Sprintf("[PLUGIN] %s", c.Description),
Aliases: c.Aliases,
RunE: func(cmd *cobra.Command, args []string) error {
ax := []string{c.Name}
ax = append(ax, args...)
Expand Down
5 changes: 3 additions & 2 deletions plugins/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ type Command struct {
// BuffaloCommand "generate"
BuffaloCommand string `json:"buffalo_command"`
// Description "generates a foo"
Description string `json:"description"`
Binary string `json:"-"`
Description string `json:"description"`
Aliases []string `json:"aliases"`
Binary string `json:"-"`
}

// Commands is a slice of Command
Expand Down

0 comments on commit 5bbae31

Please sign in to comment.