timvisee / prs

🔐 A secure, fast & convenient password manager CLI using GPG and git to sync.
https://gitlab.com/timvisee/prs
GNU General Public License v3.0
211 stars 8 forks source link

prs totp show - consider removing the space #19

Closed colemickens closed 1 year ago

colemickens commented 1 year ago

This is super minor, but I thought I'd ask.

I typically just hit my hotkey for a terminal and tap out prs totp clip <site> but sometimes I don't, for whatever reason, and do prs totp show <site> and then am surprised to see the TOTP code with a space in it.

As I type this, the request seems more minor and more silly, but all the same, it might be nice if that space were elided in favor of being able to double click and copy the code rather than having to click and drag, or manually type out the 6-8 characters.

Thanks either way!

timvisee commented 1 year ago

The space is there for readability, similar to how many OTP applications format the code.

Adding the -q flag hides this space.

What about using prs totp show -q <site> a few times to tap that out?

Or maybe you can define a global alias instead to make usage easier (with -q predefined)?

# Put this in ~/.bashrc or similar
alias totp="prs totp copy"
alias showtotp="prs totp show -q"

totp mysite
showtotp mysite
colemickens commented 1 year ago

Mea culpa x2. Thanks...