gobby-wiki 0.2.0

Gobby wiki CLI shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{Command, CommandOutcome, ScopeSelection, WikiError, commands, session, support};

/// Execute a parsed `gwiki` command through the public library boundary.
///
/// This passthrough is intentionally thin so embedders exercise the same
/// command dispatch path as the CLI binary.
pub fn run(command: Command) -> Result<CommandOutcome, WikiError> {
    commands::run(command)
}

/// Resolve the research scope using the same project/topic rules as CLI commands.
pub fn resolve_research_scope(
    selection: &ScopeSelection,
) -> Result<session::ResearchScope, WikiError> {
    let scope = support::scope::resolve_command_scope(selection)?;
    Ok(session::ResearchScope::from(&scope))
}