blob: 3f71050ca6251c713b36e6a59d25ce6855c268ab (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
mod db;
mod state;
use crate::state::{Client, State};
use crate::state::Threads;
use std::io::{stdin, stdout};
use termion::raw::IntoRawMode;
fn main() {
let stdin = stdin();
let screen = stdout().into_raw_mode().unwrap();
// let screen = AlternateScreen::from(screen);
// hide the cursor
let mut screen = termion::cursor::HideCursor::from(screen);
let mut threads = {
// open database
let db = crate::db::open(notmuch::DatabaseMode::ReadOnly).unwrap();
// get threads
let query = db.create_query("tag:inbox").unwrap();
let threads = query.search_threads().unwrap();
Threads::from_query(Some(String::from("tag:inbox")), threads)
};
threads.init(&mut screen);
let client = Client::new(State::Threads(threads));
client.run(screen, stdin);
}
|