Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: put hermes under root cmd #82

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hermes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ type app struct{}

func (app) Manifest(context.Context) (*plugin.Manifest, error) {
m := &plugin.Manifest{Name: "hermes"}
m.ImportCobraCommand(cmd.NewHermes(), "ignite relayer")
m.ImportCobraCommand(cmd.NewHermes(), "ignite")
return m, nil
}

func (app) Execute(_ context.Context, c *plugin.ExecutedCommand, _ plugin.ClientAPI) error {
// Run the "hermes" command as if it were a root command. To do
// so remove the first two arguments which are "ignite relayer"
// so remove the first two arguments which are "ignite"
// from OSArgs to treat "hermes" as the root command.
os.Args = c.OsArgs[2:]
os.Args = c.OsArgs[1:]
return cmd.NewHermes().Execute()
}

Expand Down
Loading