--key - and --token - read a line of standard input with no prompt, so inbuxa upgrade --key - looked stuck.
On a terminal it prints API key (paste it and press Enter): (or Relay token ...) to stderr and turns echo off while reading, so the pasted key isn't shown. Line editing and Ctrl-C still work.
Piped input is read as before, with no prompt.
One helper, readSecret, now does this for install/upgrade, join, certs, dns --refresh and relay --token; join, certs and dns had their own copies of the read.
Checked locally: gofmt, go vet (amd64 + arm64), go test -count=1 ./... (new test for the piped path).
Fixes #75 (reported in community t/232, post 34).
`--key -` and `--token -` read a line of standard input with no prompt, so `inbuxa upgrade --key -` looked stuck.
- On a terminal it prints `API key (paste it and press Enter): ` (or `Relay token ...`) to stderr and turns echo off while reading, so the pasted key isn't shown. Line editing and Ctrl-C still work.
- Piped input is read as before, with no prompt.
- One helper, `readSecret`, now does this for install/upgrade, join, certs, `dns --refresh` and relay `--token`; join, certs and dns had their own copies of the read.
Checked locally: gofmt, go vet (amd64 + arm64), `go test -count=1 ./...` (new test for the piped path).
`--key -` and `--token -` read a line of standard input with no prompt,
so `inbuxa upgrade --key -` looked stuck. On a terminal it now prints
"API key (paste it and press Enter): " to stderr and doesn't echo what's
pasted. Piped input is read as before.
One helper, readSecret, now reads it for install/upgrade, join, certs,
dns --refresh and relay --token, instead of three copies of the read.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #75 (reported in community t/232, post 34).
--key -and--token -read a line of standard input with no prompt, soinbuxa upgrade --key -looked stuck.API key (paste it and press Enter):(orRelay token ...) to stderr and turns echo off while reading, so the pasted key isn't shown. Line editing and Ctrl-C still work.readSecret, now does this for install/upgrade, join, certs,dns --refreshand relay--token; join, certs and dns had their own copies of the read.Checked locally: gofmt, go vet (amd64 + arm64),
go test -count=1 ./...(new test for the piped path).