use anyhow::Result;
use tokio::net::TcpStream;
use tracing::info;
use std::net::SocketAddr;
use std::path::PathBuf;
use crate::server;

pub async fn run(
    connect: SocketAddr,
    file: PathBuf,
    no_assert: bool,
    delay: bool,
    text_diff: bool,
) -> Result<()> {
    let socket = TcpStream::connect(&connect).await?;
    info!("Connected to {}", connect);

    server::handle_connection(socket, file, no_assert, delay, false, text_diff, true).await
}
