ipfs/kubo

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

Open

#4.904 geöffnet am 1. Apr. 2018

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Go (2.725 Forks)batch import
help wantedkind/enhancementtopic/commands

Repository-Metriken

Stars
 (13.906 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 4T 2h) (28 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide