chore: restructure and update deps
Some checks failed
/ build (push) Has been cancelled

This commit is contained in:
🪞👃🪞 2025-04-06 01:16:30 +03:00
parent 6bc456c814
commit 07f6f82268
22 changed files with 298 additions and 108 deletions

36
cli/src/main.rs Normal file
View file

@ -0,0 +1,36 @@
use std::sync::Arc;
use std::path::PathBuf;
use std::fs::canonicalize;
use clap::{arg, command, value_parser};
use vestal::Module;
/// Define command line arguments.
fn cli () -> clap::Command {
command!()
.arg(arg!([path] "Path to VST DLL").value_parser(value_parser!(PathBuf)))
//.arg(arg!(-s --stub <VALUE> "Provide a stub import").required(false))
.arg(arg!(-i --inspect "Show info, don't run").required(false))
.arg(arg!(-v --verbose "Show a lot of info").required(false))
}
fn main () -> Result<(), Box<dyn std::error::Error>> {
// Parse command line arguments.
let args = cli().get_matches();
if let Some(path) = args.get_one::<PathBuf>("path") {
Module::from_path(path, *(args.get_one::<bool>("verbose").unwrap_or(&false)))
.map(Arc::new)
.unwrap_or_else(|e|panic!("failed to open: {e:?}"))
.search(std::env::current_dir()?)
.search(canonicalize(path.clone().parent().expect("invalid parent path"))?)
.search("/home/user/Lab/Cosmo/wineprefix/drive_c/windows/system32")
.load(true)
.unwrap_or_else(|e|panic!("failed to load: {e:?}"))
.resolve(true)
.unwrap_or_else(|e|panic!("failed to resolve: {e:?}"))
.relink()
.unwrap_or_else(|e|panic!("failed to relink: {e:?}"));
} else {
println!("Pass a path to a VST DLL");
}
Ok(())
}