pace-rs / pace

Mindful Time Tracking: Simplify Your Focus and Boost Productivity Effortlessly.
https://pace.cli.rs
GNU Affero General Public License v3.0
20 stars 0 forks source link

Add access to comprehensive documentation directly from the CLI. #13

Closed simonsan closed 6 months ago

simonsan commented 6 months ago

Something like a docs command could be helpful:

//! `docs` subcommand

use abscissa_core::{status_err, Application, Command, Runnable, Shutdown};
use clap::Args;

use crate::application::PACE_APP;

/// Opens the documentation.
#[derive(Command, Debug, Args, Clone)]
pub struct DocsCmd {
  dev: bool
}

impl Runnable for DocsCmd {
    fn run(&self) {
        match open::that("https://pace.cli.rs/docs") {
            Ok(_) => {}
            Err(err) => {
                status_err!("{}", err);
                PACE_APP.shutdown(Shutdown::Crash);
            }
        };
    }
}