2 releases
0.0.2 | Jun 25, 2019 |
---|---|
0.0.1 | Jun 24, 2019 |
#358 in #url
22KB
426 lines
Command line tool for kutt.it
work in progress
Install
cargo install kutt
Set apikey
kutt --login your-api-key
# or
export KUTT_API_KEY='your-api-key'
Example
kutt --target-url https://github.com/ --custom-url your-domain
# or
echo 'https://github.com/' | kutt -c your-domain
Usage command line
USAGE:
kutt [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-c, --custom-url <DOMAIN> Set a domain name
-d, --delete <URL> Set a url
-l, --login <API_KEY> Set a apikey
-p, --password <PASSWORD> Set a password
-t, --target-url <URL> Set a url
How to use crate
cargo add kutt
extern crate dotenv;
extern crate kutt;
use dotenv::dotenv;
use kutt::Kutt;
fn main() {
dotenv().ok(); // read KUTT_API_KEY in .env file
let slink = Kutt::target_url("https://addr-example...")
.custom_url("custom-url")
.create_short_link()
.unwrap();
println!("{}", slink);
}
Dependencies
~21–32MB
~546K SLoC