Switch to a command-line API closer to TaskWarrior
* Use a parser (rather than clap) to process the command line * Outline some generic support for filtering, reporting, modifying, etc. * Break argument parsing strictly from invocation, to allow independent testing
This commit is contained in:
14
cli/src/invocation/cmd/test.rs
Normal file
14
cli/src/invocation/cmd/test.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use taskchampion::{server, taskstorage, Replica, ServerConfig};
|
||||
use tempdir::TempDir;
|
||||
|
||||
pub(super) fn test_replica() -> Replica {
|
||||
let storage = taskstorage::InMemoryStorage::new();
|
||||
Replica::new(Box::new(storage))
|
||||
}
|
||||
|
||||
pub(super) fn test_server(dir: &TempDir) -> Box<dyn server::Server> {
|
||||
server::from_config(ServerConfig::Local {
|
||||
server_dir: dir.path().to_path_buf(),
|
||||
})
|
||||
.unwrap()
|
||||
}
|
||||
Reference in New Issue
Block a user