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

fix: add missing verbose mode flags (backport #4286) #4287

Merged
merged 3 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [#4262](https://github.com/ignite/cli/pull/4262) Bring back relayer command
- [#4269](https://github.com/ignite/cli/pull/4269) Add custom flag parser for extensions
- [#4270](https://github.com/ignite/cli/pull/4270) Add flags to the extension hooks commands
- [#4286](https://github.com/ignite/cli/pull/4286) Add missing verbose mode flags

## [`v28.5.0`](https://github.com/ignite/cli/releases/tag/v28.5.0)

Expand Down
2 changes: 1 addition & 1 deletion ignite/cmd/chain_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ for your current environment.
c.Flags().AddFlagSet(flagSetCheckDependencies())
c.Flags().AddFlagSet(flagSetSkipProto())
c.Flags().AddFlagSet(flagSetDebug())
c.Flags().AddFlagSet(flagSetVerbose())
c.Flags().Bool(flagRelease, false, "build for a release")
c.Flags().StringSliceP(flagReleaseTargets, "t", []string{}, "release targets. Available only with --release flag")
c.Flags().StringSlice(flagBuildTags, []string{}, "parameters to build the chain binary")
c.Flags().String(flagReleasePrefix, "", "tarball prefix for each release target. Available only with --release flag")
c.Flags().StringP(flagOutput, "o", "", "binary output path")
c.Flags().BoolP("verbose", "v", false, "verbose output")

return c
}
Expand Down
5 changes: 1 addition & 4 deletions ignite/cmd/chain_faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ func chainFaucetHandler(cmd *cobra.Command, args []string) error {
var (
toAddress = args[0]
coins = args[1]
session = cliui.New(
cliui.WithVerbosity(getVerbosity(cmd)),
cliui.StartSpinner(),
)
session = cliui.New(cliui.StartSpinner())
)
defer session.End()

Expand Down
1 change: 1 addition & 0 deletions ignite/cmd/chain_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ commands manually to ensure a production-level node initialization.
c.Flags().AddFlagSet(flagSetCheckDependencies())
c.Flags().AddFlagSet(flagSetSkipProto())
c.Flags().AddFlagSet(flagSetDebug())
c.Flags().AddFlagSet(flagSetVerbose())
c.Flags().StringSlice(flagBuildTags, []string{}, "parameters to build the chain binary")

return c
Expand Down
3 changes: 2 additions & 1 deletion ignite/cmd/chain_serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

const (
flagVerbose = "verbose"
flagConfig = "config"
flagForceReset = "force-reset"
flagGenerateClients = "generate-clients"
Expand Down Expand Up @@ -70,7 +71,7 @@ production, you may want to run "appd start" manually.
c.Flags().AddFlagSet(flagSetHome())
c.Flags().AddFlagSet(flagSetCheckDependencies())
c.Flags().AddFlagSet(flagSetSkipProto())
c.Flags().BoolP("verbose", "v", false, "verbose output")
c.Flags().AddFlagSet(flagSetVerbose())
c.Flags().BoolP(flagForceReset, "f", false, "force reset of the app state on start and every source change")
c.Flags().BoolP(flagResetOnce, "r", false, "reset the app state once on init")
c.Flags().Bool(flagGenerateClients, false, "generate code for the configured clients on reset or source code change")
Expand Down
8 changes: 7 additions & 1 deletion ignite/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,14 @@ To get started, create a blockchain:
}, nil
}

func flagSetVerbose() *flag.FlagSet {
fs := flag.NewFlagSet("", flag.ContinueOnError)
fs.BoolP(flagVerbose, "v", false, "verbose output")
return fs
}

func getVerbosity(cmd *cobra.Command) uilog.Verbosity {
if verbose, _ := cmd.Flags().GetBool("verbose"); verbose {
if verbose, _ := cmd.Flags().GetBool(flagVerbose); verbose {
return uilog.VerbosityVerbose
}

Expand Down
Loading