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

power: handle confirmation dialog #9

Closed
wants to merge 1 commit into from

Conversation

rchincha
Copy link
Contributor

@rchincha rchincha commented Feb 22, 2021

SERIAL-NUMBER /chassis # power cycle
This operation will change the server's power state.
Do you want to continue?[y|N]

Copy link
Collaborator

@smoser smoser left a comment

Choose a reason for hiding this comment

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

I knew that I had seen this, but wasn't sure if I'd gotten around to making it work.

I think that what I would like to do is just always "watch" responses for a "are you sure" prompt and always send 'y'. My feeling is that the caller of the api wanted done what they wanted done. Its annoying that there is no way to send '--yes-i-mean-it' on the cli.

Does that make sense? can you do something like that?

@@ -132,7 +132,7 @@ func (cs *Session) SendCmd(ctx context.Context, msg string) (string, error) {
send = msg
} else {
for _, n := range noMoreCmds {
if fields[0] == n {
if strings.Contains(fields[0], n) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this necessary?

@smoser
Copy link
Collaborator

smoser commented Feb 23, 2021

I put up #10 that always sends confirm to prompts.

@rchincha rchincha closed this Feb 23, 2021
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.

2 participants