diff options
author | Joe Wilm <joe@jwilm.com> | 2017-01-02 20:15:24 -0800 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2017-01-02 20:15:24 -0800 |
commit | 06991e6eee4c80f99c069ff1b928bcb2111b1c3d (patch) | |
tree | 3f0768f7fd0000ee2805eb70e6bec2605dfb3e00 /copypasta | |
parent | a105be82cf4c333ae691fe7f021fca8fe2b9788e (diff) | |
download | alacritty-06991e6eee4c80f99c069ff1b928bcb2111b1c3d.tar.gz alacritty-06991e6eee4c80f99c069ff1b928bcb2111b1c3d.zip |
Better error message when xclip is not available
Resolves #37.
Diffstat (limited to 'copypasta')
-rw-r--r-- | copypasta/src/x11.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/copypasta/src/x11.rs b/copypasta/src/x11.rs index 3f64453c..32844753 100644 --- a/copypasta/src/x11.rs +++ b/copypasta/src/x11.rs @@ -45,7 +45,14 @@ impl ::std::error::Error for Error { impl ::std::fmt::Display for Error { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { match *self { - Error::Io(ref err) => write!(f, "error calling xclip: {}", err), + Error::Io(ref err) => { + match err.kind() { + io::ErrorKind::NotFound => { + write!(f, "Please install `xclip` to enable clipboard support") + }, + _ => write!(f, "error calling xclip: {}", err), + } + }, Error::Xclip(ref s) => write!(f, "error from xclip: {}", s), Error::Utf8(ref err) => write!(f, "error parsing xclip output: {}", err), } |