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

Pass in yes flag for minder cli commands that have a prompt message #1519

Closed
rdimitrov opened this issue Nov 6, 2023 · 5 comments · Fixed by #1730
Closed

Pass in yes flag for minder cli commands that have a prompt message #1519

rdimitrov opened this issue Nov 6, 2023 · 5 comments · Fixed by #1730
Assignees
Labels
enhancement New feature or request go Pull requests that update Go code good first issue Good for newcomers help wanted Extra attention is needed

Comments

@rdimitrov
Copy link
Member

It would be useful to pass in a 'yes' prompt (or no for that matter) when performing commands that have a confirmation prompt, i.e. minder auth delete.

@rdimitrov rdimitrov added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed go Pull requests that update Go code labels Nov 6, 2023
@hemakshis
Copy link
Contributor

Hi @rdimitrov
I'd like to take up this issue. Since this is my first time here, would appreciate any help or pointers!

@JAORMX
Copy link
Contributor

JAORMX commented Nov 21, 2023

Hey @hemakshis ! We really appreciate you wanting to contribute! It's a little late in Europe where some of us are. But we'll get you more details tomorrow morning. Unless someone from the team works late today. Thanks again!

@rdimitrov
Copy link
Member Author

Hi @rdimitrov I'd like to take up this issue. Since this is my first time here, would appreciate any help or pointers!

Hey @hemakshis 👋 This is great, thanks for reaching out! 💯

The goal of this issue is to implement a --yes/-y flag for some of the minder commands. The issue mentions also the option of adding a --no/-n flag, but let's leave that aside for now (but do share if you found a command where calling it with a --no flag would be valuable).

Here's some helpful information.

Implementation hints:

  • Find all minder CLI commands that have prompts (use cli.PrintYesNoPrompt())
  • Add the --yes/-y flag to each command that you found that make sense to have this as an optional flag
  • Update each command implementation so it uses the value of the flag accordingly, i.e. skipping the prompts.

References:

  • Get familiar with our contributing guidelines - here
  • Minder uses two complementary frameworks for the CLI implementation - cobra and viper. You can check their docs/examples to get a sense of their usage.
  • This is how a similar flag is added to a command - here
  • This is how you can use its value - here
  • This is how you can make decisions based on its value - here

Feel free to reach out if I've missed something or you have any questions 👍

@hemakshis
Copy link
Contributor

Thanks @rdimitrov for such detailed info, I will try it out and let you know how it goes on Monday :)

@hemakshis
Copy link
Contributor

Hi @rdimitrov
I have created #1730, please review 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go Pull requests that update Go code good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants