ovecc read
One element's source instead of a whole file.
Usage: ovecc read <TARGET> [OPTIONS]
Opening a 2,000-line file to look at one 20-line function costs the reader — human or
agent — the whole file. read resolves the element and prints only it.
Target forms
| Form | Prints |
|---|---|
symbolName | The symbol's exact body, line-numbered, with a file:start-end header |
path/file.ts:42 | The enclosing symbol at that line |
path/file.ts:10-40 | That range |
path/file.ts | The file's symbol outline, to pick from |
The file:line form is the one query,
impact, and grep already
emit, so their output pipes straight in.
Example
$ ovecc read attach_entry
crates/ovecc-graph/src/acdc.rs:338-358 function attach_entry
338 fn attach_entry(graph: &mut DiGraph<(), ()>, entry: NodeIndex, nodes: &[NodeIndex]) {
339 let sources: Vec<NodeIndex> = nodes
340 .iter()
341 .copied()
342 .filter(|node| {
343 graph
344 .neighbors_directed(*node, petgraph::Direction::Incoming)
345 .next()
346 .is_none()
347 })
348 .collect();
349 let mut seen = vec![false; nodes.len() + 1];
350 seen[entry.index()] = true;
Ambiguous names
Several definitions under one name list their anchors instead of guessing which one you
meant. Pass the file:line anchor from the list to get the body.
Options
| Option | Effect |
|---|---|
--limit <n> | Maximum lines to print before truncating (default 200; 0 = no cap) |
Plus the global options.
Related
grep— find the span firstexplain— what the element does, not its sourceexport context— the full deterministic slice around it