Skip to content

Commit

Permalink
update dependencies, improve cli
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Jun 4, 2016
1 parent bf3799b commit 1472fca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "disque-cli"
version = "0.2.0"
version = "0.2.1"
authors = ["Qing Yan <admin@zensh.com>"]
description = "Redis CLI."
documentation = "https://github.com/iorust/disque-cli"
Expand All @@ -11,10 +11,10 @@ keywords = ["disque", "CLI"]
license = "MIT/Apache-2.0"

[dependencies]
resp = "^0.3.2"
resp = "^0.3.6"

[dependencies.clap]
version = "^2.1.2"
version = "^2.5.2"
default-features = false
features = ["yaml"]

Expand Down
16 changes: 13 additions & 3 deletions src/bin/disque-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use std::io::prelude::*;
use std::str::FromStr;
use clap::{Arg, App};

use disque_cli::{create_client};
use disque_cli::{create_client, Client};

fn main() {
let matches = App::new("disque-cli")
.version("0.2.0")
.version("0.2.1")
.author("Qing Yan <admin@zensh.com>")
.arg(Arg::with_name("hostname")
.short("h")
Expand Down Expand Up @@ -47,7 +47,17 @@ fn main() {
hostname = _hostname;
}

let mut client = create_client(hostname, port, password).expect("Failed to connect");
let mut client: Client = match create_client(hostname, port, password) {
Ok(cli) => {
println!("Disque [{}]:{} connected.", hostname, port);
cli
}
Err(err) => {
println!("Disque [{}]:{} connect failed. {}", hostname, port, err);
return
}
};

let stdin = io::stdin();
let mut stdout = io::stdout();
let mut stderr = io::stderr();
Expand Down

0 comments on commit 1472fca

Please sign in to comment.