~vpzom/shoved

a00ac04702ff4008436a76740db10c4b154b42d0 — Colin Reeder 1 year, 11 days ago 533414b
Improve errors in register
1 files changed, 11 insertions(+), 2 deletions(-)

M src/bin/register.rs
M src/bin/register.rs => src/bin/register.rs +11 -2
@@ 1,7 1,16 @@
use std::io::Write;

fn main() {
    let exec = std::env::args().skip(1).next().expect("Missing executable");
    let mut args = std::env::args();
    let _ = args.next(); // ignore self name

    let exec = match args.next() {
        None => {
            println!("Usage: shoved-register EXECUTABLE");
            std::process::exit(1);
        }
        Some(exec) => exec,
    };

    let user_path = {
        let mut path = dirs::runtime_dir().unwrap_or_else(|| std::path::PathBuf::from("/tmp"));


@@ 21,7 30,7 @@ fn main() {
            _ => Err(err),
        },
    }
    .unwrap();
    .expect("Failed to connect to shoved");

    stream
        .write_all(