Skip to content
This repository was archived by the owner on Jul 25, 2023. It is now read-only.

Feat/list sort #19

Merged
merged 7 commits into from
Oct 19, 2022
Merged

Feat/list sort #19

merged 7 commits into from
Oct 19, 2022

Conversation

xNaCly
Copy link
Owner

@xNaCly xNaCly commented Oct 19, 2022

--sort_by <sort_by>        sort tasks by given param: (id, due, finished, title, priority, tag)
--sort_order <sort_order>  sort direction: (asc, desc)
# sort list output by task property
opus list --sort_by=id
opus list --sort_by=due
opus list --sort_by=finished
opus list --sort_by=title
opus list --sort_by=priority
opus list --sort_by=tag
# sort desc and asc (default sort is asc)
opus list --sort_by=id --sort_mode=desc
# [2]: 'read c how to' (2022-10-17)
# [1]: 'notion aufsetzen' (2022-10-18) #uni .1
# --
# 2 tasks found matching query: 'list'

xNaCly and others added 5 commits October 19, 2022 13:02
- add command flag --sort_by to clap parsing
- add SortMode and SortDirection enums
- add the above as params to cli::cli_get_tasks, db::Database::get_tasks
* test: add missing asserts to task.compare_content() calls

While refactoring the test task compare code into `Task::content_compare`
the asserts went missing (oh no). Adds them back so that if the
comparsion return false the tests will fail.

* test: fix finish_task test
- added two flags to the opus list command:
  --sort_by=<id, due, finished, title, priority, tag>
  --sort_order=<asc, desc>
- renamed SortDirection to SortOrder
- updated tests to include new cli::cli_get_tasks parameters
- changed Database::get_tasks::sql_query to type String
@xNaCly xNaCly linked an issue Oct 19, 2022 that may be closed by this pull request
@xNaCly xNaCly merged commit 95d7a21 into master Oct 19, 2022
@xNaCly xNaCly deleted the feat/list-sort branch October 19, 2022 12:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add possibility in opus list to sort tasks
2 participants