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

Stop asking for confirmation when non-interactive modify #189

Open
DamienCassou opened this issue Sep 28, 2018 · 6 comments
Open

Stop asking for confirmation when non-interactive modify #189

DamienCassou opened this issue Sep 28, 2018 · 6 comments

Comments

@DamienCassou
Copy link

Would it be possible to get rid of the confirmation question when
stdin is used as input for modify? When used in a program, it is
impossible to pass both the yaml content and the answer to the
question through stdin.

$ khard modify --uid 8a < /tmp/damien.yaml
[…]
Do you want to proceed (y/n)?

Expected: no question because I already use stdin to pass the contact,
I can't use it to also answer the question.

@lucc
Copy link
Owner

lucc commented Dec 27, 2018

If I understand the code in khard/khard.py line 1790-1803 correctly we reopen the terminal device to read the answer from the user after reading the input. Does it not work for you?

@DamienCassou
Copy link
Author

Does it not work for you?

I don't know how to do that, not even if it is possible.

@lucc
Copy link
Owner

lucc commented Dec 28, 2018

For me it works.

~% khard ls -a dropin 
Address book: dropin
Index    Name            Phone    E-Mail    UID   
1        von Bar, Foo                       t     
~% khard modify  -a dropin --uid=t < foo 
Modification

Name: Foo hans von Bar
Address book: dropin
Miscellaneous
    UID: t9bo8ud06exx18qnar01kdkhhvb1mcrel7tl

Do you want to proceed (y/n)? y
Done
~% khard ls -a dropin                  
Address book: dropin
Index    Name                 Phone    E-Mail    UID   
1        von Bar, Foo hans                       t     

After reading the file from stdin the terminal device is opened again and connected to stdin.

@lucc
Copy link
Owner

lucc commented Dec 28, 2018

Non the less your feature request is interesting and can be discussed.

@DamienCassou
Copy link
Author

Sorry, I wasn't clear enough. I don't know how to confirm using stdin when calling khard from a program.

@lucc
Copy link
Owner

lucc commented Dec 28, 2018

I think you can open a pull request with a new option --assume-yes or --no-confirm or so. Many package managers have that.

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

No branches or pull requests

2 participants