org-cli 0.0.5

Command-line tool for searching, reading, and managing org-mode knowledge bases with fuzzy text search and structured content access
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::config::CliConfig;
use anyhow::Result;
use clap::Args;
use org_core::OrgMode;

#[derive(Args)]
pub struct ReadCommand {
    /// Relative path to the org file to read
    file: String,
}

impl ReadCommand {
    pub fn execute(&self, org_mode: OrgMode, _cli: CliConfig) -> Result<()> {
        let content = org_mode.read_file(&self.file)?;
        println!("{}", content);
        Ok(())
    }
}