misc

Misc scripts and tools
git clone git://git.alexwennerberg.com/misc
Log | Files | Refs | README | LICENSE

commit 5df16c096c92cbe1008ed8bb3ee1d0b53bd27762
parent d629a90b3c575ed4ad70fb700a315dd4dbc69093
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 24 Oct 2021 14:32:11 -0700

Update client

Diffstat:
Mfinger.rs | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/finger.rs b/finger.rs @@ -39,8 +39,13 @@ fn main() -> std::io::Result<()> { } host = params[1]; } - let mut stream = - TcpStream::connect(format!("{}:79", host)).expect("Couldn't connect to the server."); + let dest: String; + if !host.contains(":") { + dest = format!("{}:79", host); + } else { + dest = host.to_owned(); + } + let mut stream = TcpStream::connect(dest).expect("Couldn't connect to the server."); // Only supports queries of type Q1 // https://datatracker.ietf.org/doc/html/rfc1288#section-2.3 @@ -61,5 +66,6 @@ fn main() -> std::io::Result<()> { stdout.write_all(&[*byte])?; } } + println!(""); Ok(()) }