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: accepts -i for interactive. arguments are mandatory #186

Merged
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
2 changes: 1 addition & 1 deletion cmd/config/init/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func addFlags(cmd *cobra.Command) error {
cmd.Flags().StringP(FlagNames.HubID, "", StagingHubID, fmt.Sprintf("The ID of the Dymension hub. %s", getAvailableHubsMessage()))
cmd.Flags().StringP(FlagNames.RollappBinary, "", consts.Executables.RollappEVM, "The rollapp binary. Should be passed only if you built a custom rollapp")
cmd.Flags().StringP(FlagNames.TokenSupply, "", defaultTokenSupply, "The total token supply of the RollApp")
cmd.Flags().BoolP(FlagNames.Interactive, "", false, "Run roller in interactive mode")
cmd.Flags().BoolP(FlagNames.Interactive, "i", false, "Run roller in interactive mode")
cmd.Flags().UintP(FlagNames.Decimals, "", 18,
"The precision level of the RollApp's token defined by the number of decimal places. "+
"It should be an integer ranging between 1 and 18. This is akin to how 1 Ether equates to 10^18 Wei in Ethereum. "+
Expand Down
8 changes: 0 additions & 8 deletions cmd/config/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ func InitCmd() *cobra.Command {
return nil
}

if len(args) == 0 {
fmt.Println("No arguments provided. Running in interactive mode.")
if err := cmd.Flags().Set(FlagNames.Interactive, "true"); err != nil {
return err
}
return nil
}

if len(args) < 2 {
return fmt.Errorf("invalid number of arguments. Expected 2, got %d", len(args))
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/config/init/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ func RunInteractiveMode(cfg *config.RollappConfig) {
}

promptDenom := promptui.Prompt{
Label: "Specify your RollApp denom",
Default: "RAX",
Label: "Specify your RollApp denom",
Default: "RAX",
AllowEdit: true,
Validate: func(s string) error {
if !config.IsValidTokenSymbol(s) {
return fmt.Errorf("invalid token symbol")
Expand Down