presets for some startingpoints added

This commit is contained in:
Hermes Agent
2026-08-17 06:40:12 +00:00
parent bcc829c7c2
commit 1f9f00ae7a
6 changed files with 1603 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ use crossterm::{
execute,
terminal::{EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode},
};
use db::Database;
use db::{Database, Preset};
use ratatui::{Terminal, backend::CrosstermBackend};
#[derive(Debug, Parser)]
@@ -34,6 +34,9 @@ struct Args {
/// Populate a new document with representative items
#[arg(long)]
demo: bool,
/// Initialize a new document with a complete example workspace
#[arg(long, value_enum, conflicts_with = "demo")]
preset: Option<Preset>,
/// Import a text or iCalendar (.ics) file, then exit
#[arg(long)]
import: Option<PathBuf>,
@@ -58,6 +61,9 @@ fn main() -> Result<()> {
if args.demo {
db.seed_demo()?;
}
if let Some(preset) = args.preset {
db.apply_preset(preset)?;
}
if let Some(import) = args.import {
let count = db.import_path(&import)?;
println!("Imported {count} item(s) into {}", path.display());