~kmaasrud/toe

9de2fd4de9222980571e81d1c97f2904cd2e3a6f — Knut Magnus Aasrud 9 months ago e87acf6 main
chore: rename toenail > tiptoe, add foot to README
3 files changed, 2 insertions(+), 18 deletions(-)

M README.md
R src/bin/{toenail.rs => tiptoe.rs}
M src/bin/toed.rs
M README.md => README.md +2 -2
@@ 1,4 1,4 @@
# toe
# 🦶 toe

To run the daemon:



@@ 10,7 10,7 @@ This will start the daemon process, which listens on a TCP socket at
`127.0.0.1:1702`. You can then query information with the client:

```
$ cargo run --bin toenail [command]
$ cargo run --bin tiptoe [command]
```

Replace `[command]` with the command you want to send to the server. There are

R src/bin/toenail.rs => src/bin/tiptoe.rs +0 -0
M src/bin/toed.rs => src/bin/toed.rs +0 -16
@@ 1,9 1,7 @@
use std::collections::HashMap;
use std::env;
use std::error::Error;
use std::io::{BufRead, BufReader, Write};
use std::net::{TcpListener, TcpStream};
use std::process;
use std::sync::{Arc, Mutex};
use std::thread;



@@ 66,17 64,3 @@ fn handle_client(

    Ok(())
}

fn get_user() -> Option<String> {
    if let Some(user) = env::var_os("USER") {
        return Some(user.into_string().unwrap());
    }

    if let Ok(output) = process::Command::new("id").arg("-un").output() {
        if output.status.success() {
            return Some(String::from_utf8(output.stdout).ok()?);
        }
    }

    None
}