dialtone 0.1.0

Dialtone Command Line Client
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use requestty::Question;

pub fn do_login(host_name: &str) {
    let questions = vec![
        Question::input("username")
            .message("Enter user name")
            .build(),
        Question::password("password")
            .message("Enter password")
            .mask('*')
            .build(),
    ];

    let answers = requestty::prompt(questions).unwrap();
    let user_name = answers.get("username").unwrap().as_string().unwrap();
    println!("Logged in to {host_name} as {user_name}");
}