Closed mbauhardt closed 2 days ago
- to be able to pipe content to
pa
It's already possible, it's just more convoluted:
$ echo -e 'nhello world\nhello world' | pa a Notes/my-secret-notes
Generate a password? [y/N]: n
Enter a password:
Enter a password (again):
Saved 'Notes/my-secret-notes' to the store.
I guess we could detect if there is piped input and disable interactivity in that case so that your example works as intended - that does seem reasonable to me. Though that would break our menu scripts because they pipe 'y' so that password is generated. We can say it now generates a password if we pipe an empty string to account for this, but this may be a bit unintuitive. One more option that came to mind, which is also weird, is we leave the first y/n prompt for generation as is so that menu scripts work like they do now, but you don't have to double your password in input:
$ echo 'nhello world' | pa a Notes/my-secret-notes
rm
the password file before you add it again. If you want to do it with pa, you can do it like this (you can also pipe echo y
or yes
- whichever you prefer):
$ printf y | pa d name
Delete password 'name'? [y/N]: y
Awesome, All your example snippets works fine. For my taste this is enough and solves all my issues/questions i have.
you can close this issue if you want. maybe adding this to the FAQ/readme would give an answer to other people if they want to programatically works with pa.
background: i access my google mails via oauth2 and save my tokens with pa. the refresh token is refreshed via cron job and i need a way to pipe this token to pa.
thx marko
why
For scripting purpose it would be helpful
pa
smth like