redox/src/bin/runtime_deps_of.rs
Anhad Singh 5b6e0ebe35
fix(runtime_deps_of): do not error out if no packages are specified
This may be the case if repo.sh did not build any TOML recipes. In that
case, we can just exit cleanly.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2025-02-02 16:55:14 +11:00

21 lines
498 B
Rust

use cookbook::recipe::CookRecipe;
use std::{env::args, process::ExitCode};
/// Same as `cookbook/src/bin/cook.rs`.
const DEP_DEPTH: usize = 16;
fn usage() {
eprintln!("Usage: pkg_deps_of [package1 package2 ...]");
}
fn main() -> ExitCode {
let names = args().skip(1).collect::<Vec<String>>();
let recipes = CookRecipe::new_recursive(&names, DEP_DEPTH, true).expect("recipe not found");
for recipe in recipes {
println!("{}", recipe.name);
}
ExitCode::SUCCESS
}