File size: 749 Bytes
d5bfab8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//! The `loda-rust dependencies` subcommand, prints dependencies of a program.
use super::{DependencyManager,DependencyManagerFileSystemMode};
use loda_rust_core::unofficial_function::UnofficialFunctionRegistry;
use crate::config::Config;
use std::path::PathBuf;

pub fn subcommand_dependencies(program_id: u64) {
    let config = Config::load();
    let loda_programs_oeis_dir: PathBuf = config.loda_programs_oeis_dir();
    let mut dm = DependencyManager::new(
        DependencyManagerFileSystemMode::System,
        loda_programs_oeis_dir,
        UnofficialFunctionRegistry::new(),
    );
    if let Err(error) = dm.load(program_id) {
        panic!("Failure during loadin of program. error: {:?}", error);
    }
    dm.print_dependencies();
}