pass-otp
pass-otp copied to clipboard
Added TOTP time remaining calc and printout
In reference to feature request #94. I've added a TOTP time remaining calculation and the accompanying printout to TOTP code requests.
This adds a reliance on the system date program to print out the current unix time.
So, I'm a little bit worried that echoing the time remaining universally would break existing tools/scripts that read the code.
Would you mind if I built upon this to echo in interactive terminals only?
Would you mind if I built upon this to echo in interactive terminals only?
That absolutely seems reasonable.
Would you mind if I built upon this to echo in interactive terminals only?
Maybe it should be added behind a flag, so it doesn't break existing tools/scripts but also won't keep them from implementing this as a feature.
I'd suggest pass otp [--time,-t] to print the remaing time. Also, adding : will make it easier to parse the output.
$ pass otp --time totp-secret
698816
Expires in: 26 seconds
Would it make sense to send it to stderr instead of stdout?