#![feature(yggdrasil_os)]
use std::{path::PathBuf, process::ExitCode, os::yggdrasil::fs};

use clap::Parser;

#[derive(Debug, Parser)]
struct Args {
    target: PathBuf,
    path: PathBuf,
}

fn main() -> ExitCode {
    let args = Args::parse();

    match fs::symlink(&args.target, &args.path) {
        Ok(()) => ExitCode::SUCCESS,
        Err(error) => {
            eprintln!("{}: {error}", args.path.display());
            ExitCode::FAILURE
        }
    }
}
