ta import-tdb2
This commit is contained in:
@@ -60,6 +60,9 @@ pub(crate) enum Subcommand {
|
||||
Gc,
|
||||
Sync,
|
||||
Import,
|
||||
ImportTDB2 {
|
||||
path: String,
|
||||
},
|
||||
Undo,
|
||||
}
|
||||
|
||||
@@ -75,6 +78,7 @@ impl Subcommand {
|
||||
Gc::parse,
|
||||
Sync::parse,
|
||||
Import::parse,
|
||||
ImportTDB2::parse,
|
||||
Undo::parse,
|
||||
// This must come last since it accepts arbitrary report names
|
||||
Report::parse,
|
||||
@@ -91,6 +95,7 @@ impl Subcommand {
|
||||
Gc::get_usage(u);
|
||||
Sync::get_usage(u);
|
||||
Import::get_usage(u);
|
||||
ImportTDB2::get_usage(u);
|
||||
Undo::get_usage(u);
|
||||
Report::get_usage(u);
|
||||
}
|
||||
@@ -457,6 +462,37 @@ impl Import {
|
||||
}
|
||||
}
|
||||
|
||||
struct ImportTDB2;
|
||||
|
||||
impl ImportTDB2 {
|
||||
fn parse(input: ArgList) -> IResult<ArgList, Subcommand> {
|
||||
fn to_subcommand(input: (&str, &str)) -> Result<Subcommand, ()> {
|
||||
Ok(Subcommand::ImportTDB2 {
|
||||
path: input.1.into(),
|
||||
})
|
||||
}
|
||||
map_res(
|
||||
pair(arg_matching(literal("import-tdb2")), arg_matching(any)),
|
||||
to_subcommand,
|
||||
)(input)
|
||||
}
|
||||
|
||||
fn get_usage(u: &mut usage::Usage) {
|
||||
u.subcommands.push(usage::Subcommand {
|
||||
name: "import-tdb2",
|
||||
syntax: "import-tdb2 <directory>",
|
||||
summary: "Import tasks from the TaskWarrior data directory",
|
||||
description: "
|
||||
Import tasks into this replica from a TaskWarrior data directory. If tasks in the
|
||||
import already exist, they are 'merged'. This mode of import supports UDAs better
|
||||
than the `import` subcommand, but requires access to the \"raw\" TaskWarrior data.
|
||||
|
||||
This command supports task directories written by TaskWarrior-2.6.1 or later.
|
||||
",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
struct Undo;
|
||||
|
||||
impl Undo {
|
||||
|
||||
Reference in New Issue
Block a user