mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
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:
parent
87bb829634
commit
2c579b9f01
45 changed files with 1720 additions and 1072 deletions
28
cli/src/invocation/cmd/help.rs
Normal file
28
cli/src/invocation/cmd/help.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
use failure::Fallible;
|
||||
|
||||
pub(crate) fn execute(command_name: String, summary: bool) -> Fallible<()> {
|
||||
println!(
|
||||
"TaskChampion {}: Personal task-tracking",
|
||||
env!("CARGO_PKG_VERSION")
|
||||
);
|
||||
if !summary {
|
||||
println!();
|
||||
println!("USAGE: {} [args]\n(help output TODO)", command_name); // TODO
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_summary() {
|
||||
execute("task".to_owned(), true).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_long() {
|
||||
execute("task".to_owned(), false).unwrap();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue