kutt 0.0.2

command line tool for kutt.it service
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::apikey::ApiKey;
use crate::utils::home_dir;
use std::path::PathBuf;

pub const BASE_URL: &str = "https://kutt.it";

#[cfg(not(target_os = "windows"))]
pub const API_KEY_FILE_NAME: &str = ".kutt-api-key.txt";
#[cfg(target_os = "windows")]
pub const API_KEY_FILE_NAME: &str = "kutt-api-key.txt";
lazy_static! {
    pub static ref PATH_FILE_API_KEY: PathBuf = home_dir().unwrap().join(API_KEY_FILE_NAME);
    pub static ref KUTT_API_KEY: String = ApiKey::get()
        .expect("you need to login with your api-key or set KUTT_API_KEY environment variable !");
}