presets for some startingpoints added
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user