org-cli 0.0.1

CLI tool for org-mode file management and testing
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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) -> Result<()> {
        let content = org_mode.read_file(&self.file)?;
        println!("{}", content);
        Ok(())
    }
}