# tinyurl
An abstraction on top the [tinyurl](https://tinyurl.com) API in rust for quickly generating short urls.
## Library
- Builder
```rust
use tinyurl::TinyURL;
// without alias
let short = TinyURL::new("https://example.com").build();
assert!(short.is_ok());
// with alias
let aliased = TinyURL::new("https://example.com")
.alias("some-random-nickname")
.build();
assert!(aliased.is_ok());
```
- Macro
```rust
use tinyurl::tiny;
// without alias
let short = tiny!("https://github.com");
assert!(short.is_ok());
// with alias
let short = tiny!("https://github.com", alias = "random-random-alias");
assert!(short.is_ok());
```
## CLI
- Install
```shell
cargo install tinyurl
```
- Usage
```shell
tinyurl 0.1.0
Collins Muriuki
An abstraction on top the tinyurl API in rust for quickly generating short urls.
USAGE:
tinyurl [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-a, --alias Optional unique url alias
ARGS:
The uri to be shortened
```