-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rollkit): use default command instead cobra commands (#112)
* use default command instead cobra commands * fix GetCommands comment * remove unused flag and dependency
- Loading branch information
Showing
6 changed files
with
175 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,43 @@ | ||
package cmd | ||
|
||
import "github.com/spf13/cobra" | ||
import ( | ||
"github.com/ignite/cli/v28/ignite/services/plugin" | ||
) | ||
|
||
// NewRollkit creates a new rollkit command that holds | ||
// some other sub commands related to Rollkit. | ||
func NewRollkit() *cobra.Command { | ||
c := &cobra.Command{ | ||
Use: "rollkit [command]", | ||
Aliases: []string{"r"}, | ||
Short: "Ignite rollkit integration", | ||
SilenceUsage: true, | ||
SilenceErrors: true, | ||
// GetCommands returns the list of app commands. | ||
func GetCommands() []*plugin.Command { | ||
return []*plugin.Command{ | ||
{ | ||
Use: "rollkit [command]", | ||
Aliases: []string{"r"}, | ||
Short: "Ignite rollkit integration", | ||
Commands: []*plugin.Command{ | ||
{ | ||
Use: "add", | ||
Short: "Add rollkit support", | ||
Long: "Add rollkit support to your Cosmos SDK chain", | ||
Flags: []*plugin.Flag{ | ||
{ | ||
Name: flagPath, | ||
Usage: "path of the app", | ||
Shorthand: "p", | ||
Type: plugin.FlagTypeString, | ||
}, | ||
}, | ||
}, | ||
{ | ||
Use: "init", | ||
Short: "Init rollkit support", | ||
Flags: []*plugin.Flag{ | ||
{ | ||
Name: flagPath, | ||
Usage: "path of the app", | ||
Shorthand: "p", | ||
Type: plugin.FlagTypeString, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
// add sub commands. | ||
c.AddCommand( | ||
NewRollkitAdd(), | ||
NewRollkitInit(), | ||
) | ||
return c | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.