From fccb2c0696a97aae299b0b88c467c437b13ad937 Mon Sep 17 00:00:00 2001 From: aaron-jack-manning Date: Thu, 25 Aug 2022 20:55:28 +1000 Subject: [PATCH] minor internal documentation changes --- Cargo.lock | 2 +- README.md | 6 ++---- src/main.rs | 19 +++++++++++++++---- src/tasks.rs | 4 ++-- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d1c384f..92d9deb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -843,7 +843,7 @@ dependencies = [ [[package]] name = "toru" -version = "0.1.4" +version = "0.2.0" dependencies = [ "chrono", "clap", diff --git a/README.md b/README.md index 83f54f8..236a995 100644 --- a/README.md +++ b/README.md @@ -55,15 +55,13 @@ OPTIONS: -V, --version Print version information SUBCOMMANDS: - clean Deletes all discarded tasks complete Mark a task as complete config For making changes to global configuration - delete Delete a task completely - discard Discard a task without deleting the underlying file + delete Delete a task (move file to trash) edit Edit a task directly git Run Git commands at the root of the vault gitignore Adds the recommended .gitignore file to the vault - list Lists tasks according to the specified ordering and filters + list Lists tasks according to the specified fields, ordering and filters new Create a new task stats For statistics about the state of your vault svn Run Subversion commands at the root of the vault diff --git a/src/main.rs b/src/main.rs index 1e01258..376f200 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,8 +14,6 @@ use tasks::Id; use std::path; - - #[derive(clap::Parser, Debug)] struct Args { #[clap(subcommand)] @@ -103,32 +101,45 @@ enum Command { #[derive(clap::StructOpt, Debug, PartialEq, Eq)] pub struct ListOptions { + /// Include name column. #[clap(long)] name : bool, + /// Include tracked time column. #[clap(long)] tracked : bool, + /// Include due date column. #[clap(long)] due : bool, + /// Include tags column. #[clap(long)] tags : bool, + /// Include priority column. #[clap(long)] priority : bool, + /// Include status column. #[clap(long)] status : bool, + /// Include created date column. #[clap(long)] created : bool, + /// The field to sort by. #[clap(long, value_enum, default_value_t=SortBy::Id)] sort_by : SortBy, + /// Sort ascending on descending. #[clap(long, value_enum, default_value_t=SortType::Asc)] sort_type : SortType, + /// Only include tasks created before a certain date. #[clap(long)] before : Option, + /// Only include tasks created after a certain date. #[clap(long)] after : Option, + /// Only include tasks due within a certain number of days. #[clap(long)] due_in : Option, + /// Include completed tasks in the list. #[clap(long)] - include_complete : bool, + include_completed : bool, } impl Default for ListOptions { @@ -146,7 +157,7 @@ impl Default for ListOptions { before : None, after : None, due_in : None, - include_complete : false, + include_completed : false, } } } diff --git a/src/tasks.rs b/src/tasks.rs index bc05b04..240f405 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -446,7 +446,7 @@ pub fn list(options : super::ListOptions, vault_folder : &path::Path) -> Result< before : None, after : None, due_in : None, - include_complete : false, + include_completed : false, }; // If the arguments are not given, use a set of defaults. @@ -484,7 +484,7 @@ pub fn list(options : super::ListOptions, vault_folder : &path::Path) -> Result< } })); } - if !options.include_complete { + if !options.include_completed { tasks = Box::new(tasks.filter(|t| t.data.completed.is_none())); }