Skip to content

Conversation

@warricksothr
Copy link

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.

@tadfisher
Copy link
Owner

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?

@warricksothr
Copy link
Author

Would you mind if I built upon this to echo in interactive terminals only?

That absolutely seems reasonable.

@brunelli
Copy link

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

@davidfetter
Copy link

Would it make sense to send it to stderr instead of stdout?

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.

4 participants