ipfs/kubo

`ipfs key rm` & `ipfs name publish` error out on empty stdin rather than doing nothing

Open

#4,904 创建于 2018年4月1日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Go (2,725 fork)batch import
help wantedkind/enhancementtopic/commands

仓库指标

Star
 (13,906 star)
PR 合并指标
 (平均合并 4天 2小时) (30 天内合并 28 个 PR)

描述

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.

贡献者指南