aboutsummaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
* Add the 'tags' commandMiquel Sabaté Solà2026-01-202-0/+183
| | | | | | | This command includes the create, ls, and rm subcommands, which allow for easy management of word tags. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* words: add the poke subcommandMiquel Sabaté Solà2026-01-191-0/+27
| | | | | | | | This subcommand allows the user to update the `updated_at` timestamp, which is quite relevant as this timestamp is used when selecting words. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* run: ask for alternatives as wellMiquel Sabaté Solà2026-01-193-10/+99
| | | | | | | | This commit also fixes the need to ask for a random gender when asking for adjectives. This is somewhat unrelated to the main subject, but untying this now was a bit too much of a hassle. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Display related words on the 'words show' commandMiquel Sabaté Solà2026-01-191-1/+86
| | | | | | | This includes comparative/superlative/adverbial forms for adjectives, and alternative forms because of gender or otherwise. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add adjectives on the inflection practiceMiquel Sabaté Solà2026-01-151-84/+107
| | | | | | | For now we are limiting this only to be on the masculine gender, but this could be changed in the future. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add a 'categories' parameter to 'select_words_except'Miquel Sabaté Solà2026-01-151-1/+5
| | | | | | | This way the -c/--category flag can also work together with the -i/--inflection one. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Ask for the inflection of nouns when practicingMiquel Sabaté Solà2026-01-152-67/+203
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Simplify practice loop by removing exit codeMiquel Sabaté Solà2026-01-151-28/+16
| | | | | | | Since we no longer care that much about the exit code, we can simplify the main loop further, while also reordering how words are selected. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Touch the 'updated_at' column on exercise successMiquel Sabaté Solà2026-01-141-3/+7
| | | | | | | | | If the user runs into an exercise and is satisfied with the results, then touch the 'updated_at' column for that exercise. This is relevant because in practice exercises are selected by the lastly updated exercise. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* run: do not account errors in the exit codeMiquel Sabaté Solà2026-01-141-20/+23
| | | | | | | It's confusing with the error case, and it also gets in the way for endless mode. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* run: introduce --endless modeMiquel Sabaté Solà2026-01-141-24/+33
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Print the exercise enunciate after giving an answerMiquel Sabaté Solà2026-01-141-0/+4
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Implement the 'ls' command for exercisesMiquel Sabaté Solà2026-01-142-0/+18
| | | | | | | It was the only part missing for exercises, which was even listed in -h/--help. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add the ability to sort cases via configurationMiquel Sabaté Solà2026-01-141-58/+75
| | | | | | | | | | | This means that it's no longer a matter of configuring it via the database, but much simpler. This should be more than enough. That being said, this is to be configured by hand so to not further complicate things. This is left to be done for the future, even if the default is basically what I use. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Migrate from usize to isize for integers in modelsMiquel Sabaté Solà2026-01-142-5/+5
| | | | | | | | | | | | | | | | | | | | | | SQLite3, like many other DBs (e.g. PostgreSQL), assumes by default an i64::MAX value. Hence, while in the application we are talking mainly in unsigned terms (which is what makes sense here), this is not realistic to what ends up happening on the DB side. Up until now this just worked behind the scenes because rustqlite did the heavy lifting via default trait implementations of usize which handled this translation for us. This default implementation for usize was dropped in 0.38.0 (see [1]). Even if it can be enabled back via the "fallible_uint" feature, it's more fair to stick to isize, as it's not much of a problem on our side, and it's more transparent in regards to what happens in the end in the DB. Last but not least, this commit also upgrades rustqlite to the latest 0.38.0, with the rest of the dependency tree. [1] https://github.com/rusqlite/rusqlite/issues/1722) Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Fix style issues coming from recent mergeMiquel Sabaté Solà2026-01-134-45/+44
| | | | | | | | | I apparently merged the 'inflection' branch without checking the code style. This means that a lot of warnings are being raised by clippy and I'm unsure which commit did what. Since I'm lazy about this right now, let's bring all fixes in a single commit. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Various fixes on adjective inflectionMiquel Sabaté Solà2026-01-131-6/+58
| | | | | | | This includes providing tests and fixes for feminine adjectives with contracted roots, and feminine versions of "unus nauta" adjectives. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Add basic validation for verbs and pronounsMiquel Sabaté Solà2026-01-133-12/+26
| | | | Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
* Trim word parts on database insertMiquel Sabaté Solà2025-10-271-1/+3
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Provide initial implementation for word inflectionMiquel Sabaté Solà2025-10-275-53/+492
| | | | | | | | | | Word inflection for nouns, adjectives has been added so it can be initially be used in commands like 'words show'. Word categories which have no inflections (e.g. adverbs, conjunctions, et al) are skipped. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add the -f/--flag flag to the 'practice' commandMiquel Sabaté Solà2025-07-301-15/+45
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add exercises to the practice commandMiquel Sabaté Solà2025-07-293-12/+193
| | | | | | | | The '-e/--exercises' has also been introduced to instruct the 'practice' command to only go for exercises, and the '-k/--kind' flag allows the user to further filter which kind of exercise to practice. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add the exercises commandMiquel Sabaté Solà2025-07-293-2/+261
| | | | | | | Subcommands have been added to it which are similar to the ones on words on purpose. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add weight to wordsMiquel Sabaté Solà2025-07-291-0/+16
| | | | | | | This allows for the user to give more importance to some words than others, as that will be taken into account when running `practice`. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Rename from run to practiceMiquel Sabaté Solà2025-07-291-37/+35
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Implement the edit subcommand for wordsMiquel Sabaté Solà2025-07-291-98/+185
| | | | | | | This implied replacing the Guess struct for a full Word, so the same code for word creation could be re-used. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* words: Move away the selection of a wordMiquel Sabaté Solà2025-07-251-16/+37
| | | | | | | | This is in preparation to the implementation of the new 'edit' and 'show' subcommands for 'word', which will also need to operate on exactly one word. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Apply suggestions from clippyMiquel Sabaté Solà2025-07-255-85/+99
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Implement creation of wordsMiquel Sabaté Solà2025-07-252-21/+335
| | | | Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Add steps into wordsMiquel Sabaté Solà2025-06-131-2/+10
| | | | | | | | This is a way to make more granular the accounting of successful runs, so we don't give a word for done until we have run it successfully at least MAX_STEPS times in a row. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Implement the run commandMiquel Sabaté Solà2025-06-121-1/+141
| | | | | | | | This does not accept yet some flags that might be convenient for more advanced uses of it, nor it asks to inflect the word or stuff like that. For now it's as simple as "give me the meaning of...". Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
* Initial commitMiquel Sabaté Solà2025-06-036-0/+329
Basic commands have been added, but most of the features for this project are still work in progress. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>