Skip to main content

the_code_graph_cli/commands/
refs.rs

1use domain::error::Result;
2use domain::use_cases::query::QueryUseCase;
3
4use crate::commands::helpers::open_graph;
5use crate::commands::RefsArgs;
6use crate::output::{print, OutputFormat};
7
8pub fn run_refs(args: &RefsArgs, output_format: OutputFormat) -> Result<()> {
9    let (store, _root) = open_graph()?;
10    let uc = QueryUseCase::new(store.clone(), store);
11    let refs = uc.refs(&args.qualified_name)?;
12    print(&refs, output_format);
13    Ok(())
14}