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

cli: auto-select chain when only one is provided #313

Closed
wants to merge 1 commit into from

Conversation

najeal
Copy link
Contributor

@najeal najeal commented Jul 31, 2023

Closes #299

// auto-select if only 1 option provided
if max == 1 {
utils.Outf(
"{{cyan}}only one chain available:{{/}} autoselect\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be used for more than just "chains". Here are some more examples of usage:
image

Copy link
Contributor

@patrick-ogrady patrick-ogrady Aug 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should print the "label" concatenated with 0 (ideally in a similar form as promptui so that it is consistent)

If matching style is difficult (because they use some weird print library or something), we can use utils.Outf

@patrick-ogrady
Copy link
Contributor

Closing for #313

@najeal
Copy link
Contributor Author

najeal commented Aug 2, 2023

@patrick-ogrady sorry if I took time to make the changes. I was testing promptui but I really have problem when running the <example>/scripts/run.sh

@najeal najeal deleted the auto-select-unique-chain branch August 2, 2023 23:27
@patrick-ogrady
Copy link
Contributor

@patrick-ogrady sorry if I took time to make the changes. I was testing promptui but I really have problem when running the <example>/scripts/run.sh

No worries! Was just passing by and figured I'd knock it out real quick so you could focus on other more meaningful items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cli] Auto-Select Choice if Only 1 Given
2 participants