Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ thiserror = "2"
# Home directory resolution
dirs = "6"

# Readline for drill TUI
# Readline for turbo-m-drill TUI
rustyline = "17"

# Unicode normalization for drill
# Unicode normalization for turbo-m-drill
unicode-normalization = "0.1"

# Shuffle for drill
# Shuffle for turbo-m-drill
rand = "0.9"

[[bin]]
name = "turbo-m"
path = "src/main.rs"

[[bin]]
name = "drill"
path = "src/bin/drill.rs"
name = "turbo-m-drill"
path = "src/bin/turbo-m-drill.rs"


6 changes: 3 additions & 3 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ tm.process_reviews(&reviews)?;
Typing drill using the same database. Shows card back as prompt, you type the front.

```
drill [--db <path>] --deck <name> [--limit <n>] [--new]
turbo-m-drill [--db <path>] --deck <name> [--limit <n>] [--new]
```

```sh
drill --deck "German A1" # due cards
drill --deck "German A1" --new --limit 10 # new cards
turbo-m-drill --deck "German A1" # due cards
turbo-m-drill --deck "German A1" --new --limit 10 # new cards
Comment on lines +147 to +152
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "How it works" section below this command block still documents the old 1–3 rating mapping (correct→3, typo→2, wrong→1). Since turbo-m-drill now submits 1–4 (and distinguishes empty input), update the documentation to match the new mapping (e.g., empty→1 Again, wrong→2 Hard, typo→3 Good, correct→4 Easy) or adjust the code if the old mapping was intended.

Copilot uses AI. Check for mistakes.
```

### How it works
Expand Down
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ build:

install: build
cargo install --path .

check:
cargo fmt && cargo clippy -- -D warnings && cargo test
14 changes: 8 additions & 6 deletions src/bin/drill.rs → src/bin/turbo-m-drill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const RED: &str = "\x1b[31m";
const RESET: &str = "\x1b[0m";

#[derive(Parser)]
#[command(name = "drill", about = "Spaced repetition drill TUI")]
#[command(name = "turbo-m-drill", about = "Spaced repetition drill TUI")]
struct Cli {
/// Path to the SQLite database file (default: ~/.turbo-m.db)
#[arg(long)]
Expand Down Expand Up @@ -88,6 +88,7 @@ enum AttemptResult {
Correct,
Typo,
Wrong,
Empty,
}

fn default_db_path() -> PathBuf {
Expand Down Expand Up @@ -173,7 +174,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let card_id = dc.card.id;

let result = if normalized_input.is_empty() {
AttemptResult::Wrong
AttemptResult::Empty
} else if normalized_input == normalized_word {
AttemptResult::Correct
} else {
Expand Down Expand Up @@ -221,7 +222,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
});
}
}
AttemptResult::Wrong => {
AttemptResult::Wrong | AttemptResult::Empty => {
println!("{RED}{}{RESET}", dc.front);
let _ = rl.readline("");
queue.push(DrillCard {
Expand All @@ -245,9 +246,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.into_iter()
.map(|(card_id, result)| {
let rating = match result {
AttemptResult::Wrong => 1,
AttemptResult::Typo => 2,
AttemptResult::Correct => 3,
AttemptResult::Empty => 1,
AttemptResult::Wrong => 2,
AttemptResult::Typo => 3,
AttemptResult::Correct => 4,
};
ReviewSubmission { card_id, rating }
})
Expand Down