This repository was archived by the owner on Jul 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Add possibility in opus list
to sort tasks
#16
Milestone
Comments
opus list
to sort tasksopus list
to sort tasks
Id say this change can only be done after #14 is finished, due to the complex way argument parsing is currently done. Will add this to the milestone for the next release. |
Merged
xNaCly
added a commit
that referenced
this issue
Oct 18, 2022
# Migration to clap fixes: #14 fixes: #3 improves: #12 lays foundation for: #16 ## Changes: - migrated to clap: ```text Usage: opus <COMMAND> Commands: add create a new task [aliases: a] delete delete a task with the given id [aliases: del, d] clear remove all tasks from the database finish mark the task with the given id as finished [aliases: fin, f] list list tasks matching the given query [aliases: ls, l] export export all tasks help Print this message or the help of the given subcommand(s) Options: -h, --help Print help information -V, --version Print version information ``` - added `--finished` flag to `opus ls`: ```text list tasks matching the given query Usage: opus list [OPTIONS] [QUERY] Arguments: [QUERY] Options: -f, --finished displays tasks marked as finished -h, --help Print help information -V, --version Print version information ``` - reworked `opus export` to provide a better interface: - before ```bash # exports all tasks in the data.json file opus export json data # export all tasks in the mycsvfile.csv file opus export csv mycsvfile # data.tsv opus export tsv data ``` - after ```bash # exports all tasks in the data.json file opus export --format="json" --output="data.json" # export all tasks in the data.csv file opus export --format="csv" --output="data.csv" # export all tasks in the data.tsv file opus export --format="tsv" --output="data.csv" ``` - switched from specifing a tasks priority with symbols `,` to numbers prefixed with `.` - before: ```bash # add a new task with the following properties: # title: review and merge pr 5 # due: @Tomorrow # tag: #github # priority: 3 opus add "review and merge pr 5 @Tomorrow #github ,,," ``` - after: ```bash # add a new task with the following properties: # title: review and merge pr 5 # due: @Tomorrow # tag: #github # priority: 3 opus add "review and merge pr 5 @Tomorrow #github .3" ``` - rewrote tests and removed everything regarding the self made args parser - improved task displaying: - before: ```text [2]: 'update excel sheet' (2022-10-13) #work [,,,] ``` - after: ``` [2]: 'update excel sheet' (2022-10-13) #work .3 FINISHED ```
xNaCly
added a commit
that referenced
this issue
Oct 19, 2022
- 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
Merged
Merged
xNaCly
added a commit
that referenced
this issue
Oct 19, 2022
* feat: add foundation for sorting - 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 (#18) * 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 * feat: implemented #16 (sorting for opus list) - 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 * fix: correct help message for --sort_order * doc: added list sorting documentation * refactor: changed '_' in opus list flags to '-' * chore: update version to reflect experimental feat $ opus -V opus 0.2.0-alpha+experimental.ls-sorting Co-authored-by: Daniel <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently, tasks are output in the order that they are inside the SQLite database.
It would be pretty handy to be able to sort the displayed tasks by priority, due date or id.
This could be done with a command line flag, e.g.
--sort priority
(maybe with short forms like--sort prio
).The text was updated successfully, but these errors were encountered: