Closed tigris closed 6 years ago
I really don't like the idea of changing the existing behaviour. IMHO shush should be completely agnostic about the string you're encrypting. shush encrypt ... | shush decrypt
should be a no-op.
It's pretty common to use shush to encrypt strings containing newlines, e.g. SSH keys, TLS certs.
By chomp
I only meant to warn / remove for a trailing newline, not ones buried inside the string. I agree it should be a no-op, I wonder if a simple warn about a trailing newline might be worthwhile? While still encrypting with it in there.
Re-reading ... I'm happy with a (suppressible) warning on encrypt
.
I think I thought you were suggesting a warning on decrypt
, which would be less good.
I'm closing this issue because it's gone stale.
It is quite common to pipe a string to
shush encrypt
viaecho
and forget the-n
. It'd be nice to DWIM in this scenario, perhaps with a warning.I understand this changes behaviour and it would now be impossible to encrypt a string with a newline on the end. We could cross that bridge when it comes, or add in a flag, or not chomp but just print the warning, or document it and you could put 2 newlines to get 1 newline in there 😄