ipfs/kubo
在 GitHub 查看`ipfs key rm` & `ipfs name publish` error out on empty stdin rather than doing nothing
Open
#4,904 创建于 2018年4月1日
help wantedkind/enhancementtopic/commands
描述
Version information:
go-ipfs version: 0.4.13- Repo version: 6 System version: amd64/linux Golang version: go1.9.4
Type:
Bug
Description:
ipfs key rm and ipfs name publish (and probably other ipfs commands) will, if invoked with no positional arguments, expect input from stdin, presumably so you can pipe in the output of other ipfs commands without needing to faff around with xargs.
The problem is that when input is empty, these commands fail:
$ ipfs name publish </dev/null
ipfs: Reading from /dev/stdin; send Ctrl-d to stop.
Error: invalid 'ipfs ref' path
$ ipfs key rm </dev/null
ipfs: Reading from /dev/stdin; send Ctrl-d to stop.
Error: invalid 'ipfs ref' path
Which is a problem when (as is often the case) the command generating the input may legitimately produce empty input, e.g. ipfs key list | grep remove-me | ipfs key rm.