mirror of
https://github.com/nikolassv/bartib
synced 2025-02-26 11:57:12 +00:00
do not group tasks in list if only tasks for a given day are shown
This commit is contained in:
parent
5f03c20706
commit
374a6e8cb4
3 changed files with 30 additions and 3 deletions
28
README.md
28
README.md
|
@ -18,7 +18,7 @@ Bartib safes a journal of all tracked tasks in a plaintext file. The file can ei
|
|||
|
||||
### Help
|
||||
|
||||
Print help informations:
|
||||
Print help information:
|
||||
|
||||
```
|
||||
bartib -h
|
||||
|
@ -47,3 +47,29 @@ bartib stop
|
|||
```
|
||||
bartib current
|
||||
```
|
||||
|
||||
### List tasks
|
||||
|
||||
All tasks:
|
||||
|
||||
```
|
||||
bartib list
|
||||
```
|
||||
|
||||
Do not group tasks by date:
|
||||
|
||||
```
|
||||
bartib list --no_grouping
|
||||
```
|
||||
|
||||
List tasks in a given time range:
|
||||
|
||||
```
|
||||
bartib list --from 2021-03-01 --to 2021-11-01
|
||||
```
|
||||
|
||||
List tasks on a given day:
|
||||
|
||||
```
|
||||
bartib list --date 2021-05-17
|
||||
```
|
|
@ -61,7 +61,8 @@ pub fn list(file_name: &str, filter: TaskFilter, do_group_tasks: bool) {
|
|||
if do_group_tasks {
|
||||
output::list_tasks_grouped_by_date(&filtered_tasks[first_element .. filtered_tasks.len()]);
|
||||
} else {
|
||||
output::list_tasks(&filtered_tasks[first_element .. filtered_tasks.len()], true);
|
||||
let with_start_dates = !filter.date.is_some();
|
||||
output::list_tasks(&filtered_tasks[first_element .. filtered_tasks.len()], with_start_dates);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ fn main() {
|
|||
date : get_date_argument_or_ignore(sub_m.value_of("date"), "-d/--date")
|
||||
};
|
||||
|
||||
let do_group_tasks = !sub_m.is_present("no_grouping");
|
||||
let do_group_tasks = !sub_m.is_present("no_grouping") && !filter.date.is_some();
|
||||
bartib::list(file_name, filter, do_group_tasks);
|
||||
},
|
||||
_ => println!("Unknown command")
|
||||
|
|
Loading…
Add table
Reference in a new issue