Skip to content

Commit

Permalink
v0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ksk001100 committed Mar 4, 2020
1 parent c7660cf commit 0617668
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gtrans"
version = "0.2.0"
version = "0.2.1"
authors = ["ksk001100 <[email protected]>"]
edition = "2018"
repository = "https://github.com/ksk001100/gtrans"
Expand All @@ -11,5 +11,5 @@ description = "Google translation CLI tool written in Rust"

[dependencies]
reqwest = { version = "0.10", features = ["blocking", "json"] }
seahorse = "0.6.1"
seahorse = "0.7.0"
serde_json = "1.0"
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ fn main() {
let app = App::new()
.name(color::green("gtrans"))
.usage(usage)
.author(env!("CARGO_PKG_AUTHORS"))
.description(env!("CARGO_PKG_DESCRIPTION"))
.version(color::yellow(env!("CARGO_PKG_VERSION")))
.action(translate)
.flag(source_flag)
Expand All @@ -48,6 +50,12 @@ fn main() {
}

fn translate(c: &Context) {
if c.args.len() < 1 {
println!("Please enter text...");
return;
}


let source = match env::var("GTRANS_SOURCE") {
Ok(sl) => match c.string_flag("source") {
Some(flag) => flag,
Expand Down

0 comments on commit 0617668

Please sign in to comment.