pmis 1.0.1

Companion CLI tool for paste.misterio.me
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{Result, Session, Url};

use atty::Stream;

use std::io;

pub async fn auth(api: Url) -> Result<()> {
    if atty::is(Stream::Stdout) {
        println!("Get a token from {} and paste it here:", api.join("/keys")?);
    }
    let mut key = String::new();
    io::stdin().read_line(&mut key)?;

    Session::save(key)?;

    Ok(())
}