summaryrefslogtreecommitdiff
path: root/src/cmd.rs
blob: 308cc5f75d7195aaa3ca47025e2ba600227b3a4b (plain)
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
use std::path::PathBuf;

use maildir::Maildir;

mod count;
mod folders;
mod list;
mod move_mail;
mod raw;
mod read;
mod remove;

pub use count::count;
pub use folders::folders;
pub use list::list;
pub use move_mail::move_mail;
pub use raw::raw;
pub use read::read;
pub use remove::remove;

pub fn open_submaildir(mut path: PathBuf, sub: &str) -> Maildir {
    if !sub.is_empty() {
        path.push(String::from(".") + sub);
    }
    Maildir::from(path)
}