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

Notify user if missing flag args on create account #1668

Merged
merged 2 commits into from
Jul 3, 2024
Merged
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
12 changes: 9 additions & 3 deletions internal/accounts/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,19 @@ var createCommand = &command.Command{

func create(
_ []string,
_ command.GlobalFlags,
_ output.Logger,
globalFlags command.GlobalFlags,
logger output.Logger,
flow flowkit.Services,
state *flowkit.State,
) (command.Result, error) {
if len(createFlags.Keys) == 0 { // if user doesn't provide any flags go into interactive mode
return createInteractive(state)

if len(createFlags.SigAlgo) > 0 || globalFlags.Network != "" {
return nil, fmt.Errorf("You provided flags, but no key. A key is required to create an account in manual mode. Remove flags if you'd like to use interactive mode.")
} else {
return createInteractive(state)
}

} else {
return createManual(state, flow)
}
Expand Down
Loading