direct-connect / go-dcpp

Hybrid Direct Connect hub written in Go.
BSD 3-Clause "New" or "Revised" License
36 stars 9 forks source link

Have the ability of hidden some command error #30

Closed Kcchouette closed 5 years ago

Kcchouette commented 5 years ago

What I have:

# go-dcpp/dcping ping "dchub://XXX.ddns.net:6669" --out=xml
2019/03/03 22:18:18 dial tcp XXX.185:6669: connect: connection refused
<Hub Name="" Address="dchub://XXX.ddns.net:6669" Status="Offline"></Hub>

↑ is it possible to add something (for example a command --quiet) to only show:

# go-dcpp/dcping ping "dchub://XXX.ddns.net:6669" --out=xml
<Hub Name="" Address="dchub://XXX.ddns.net:6669" Status="Offline"></Hub>
dennwc commented 5 years ago

It writes errors on different stream (stderr), so it should be possible to ignore it.

dennwc commented 5 years ago

Something like:

go-dcpp/dcping ping "dchub://XXX.ddns.net:6669" --out=xml 2> /dev/null
Kcchouette commented 5 years ago

You can close it, I just have to ignore sterr. Thanks