Add confirmation prompts for modifications of lots of tasks
This commit is contained in:
@@ -2,13 +2,14 @@
|
||||
|
||||
use crate::argparse::{Command, Subcommand};
|
||||
use crate::settings::Settings;
|
||||
use taskchampion::{Replica, Server, ServerConfig, StorageConfig, Task, Uuid};
|
||||
use taskchampion::{Replica, Server, ServerConfig, StorageConfig, Uuid};
|
||||
use termcolor::{ColorChoice, StandardStream};
|
||||
|
||||
mod cmd;
|
||||
mod filter;
|
||||
mod modify;
|
||||
mod report;
|
||||
mod util;
|
||||
|
||||
#[cfg(test)]
|
||||
mod test;
|
||||
@@ -60,7 +61,7 @@ pub(crate) fn invoke(command: Command, settings: Settings) -> Result<(), crate::
|
||||
modification,
|
||||
},
|
||||
..
|
||||
} => return cmd::modify::execute(&mut w, &mut replica, filter, modification),
|
||||
} => return cmd::modify::execute(&mut w, &mut replica, &settings, filter, modification),
|
||||
|
||||
Command {
|
||||
subcommand:
|
||||
@@ -149,14 +150,3 @@ fn get_writer() -> StandardStream {
|
||||
ColorChoice::Never
|
||||
})
|
||||
}
|
||||
|
||||
/// Summarize a task in a single line
|
||||
fn summarize_task(replica: &mut Replica, task: &Task) -> anyhow::Result<String> {
|
||||
let ws = replica.working_set()?;
|
||||
let uuid = task.get_uuid();
|
||||
if let Some(id) = ws.by_uuid(uuid) {
|
||||
Ok(format!("{} - {}", id, task.get_description()))
|
||||
} else {
|
||||
Ok(format!("{} - {}", uuid, task.get_description()))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user