minor internal documentation changes

This commit is contained in:
aaron-jack-manning 2022-08-25 20:55:28 +10:00
parent 0f542eb054
commit fccb2c0696
4 changed files with 20 additions and 11 deletions

2
Cargo.lock generated
View File

@ -843,7 +843,7 @@ dependencies = [
[[package]]
name = "toru"
version = "0.1.4"
version = "0.2.0"
dependencies = [
"chrono",
"clap",

View File

@ -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

View File

@ -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<chrono::NaiveDateTime>,
/// Only include tasks created after a certain date.
#[clap(long)]
after : Option<chrono::NaiveDateTime>,
/// Only include tasks due within a certain number of days.
#[clap(long)]
due_in : Option<u16>,
/// 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,
}
}
}

View File

@ -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()));
}