summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2016-11-06 12:21:36 -0500
committerAndrew Gallant <jamslam@gmail.com>2016-11-06 12:21:36 -0500
commit277dda544ce0e3d5f6f3693c087a4564e8401fbf (patch)
tree9140b6d564c6b7410f01a2dd36b2d6e19b2a509e
parent8c869cbd877cedadeb75c06a4f748d2066a65bcc (diff)
Include the name "ripgrep" in more places.
Fixes #203
-rw-r--r--doc/rg.14
-rw-r--r--doc/rg.1.md4
-rw-r--r--src/args.rs17
3 files changed, 20 insertions, 5 deletions
diff --git a/doc/rg.1 b/doc/rg.1
index 3e4ed8e1..3d7c1025 100644
--- a/doc/rg.1
+++ b/doc/rg.1
@@ -21,8 +21,10 @@ rg [\f[I]options\f[]] \-\-help
rg [\f[I]options\f[]] \-\-version
.SH DESCRIPTION
.PP
-rg (ripgrep) combines the usability of The Silver Searcher (an ack
+ripgrep (rg) combines the usability of The Silver Searcher (an ack
clone) with the raw speed of grep.
+.PP
+Project home page: https://github.com/BurntSushi/ripgrep
.SH COMMON OPTIONS
.TP
.B \-a, \-\-text
diff --git a/doc/rg.1.md b/doc/rg.1.md
index e5036730..67b3c33c 100644
--- a/doc/rg.1.md
+++ b/doc/rg.1.md
@@ -18,9 +18,11 @@ rg [*options*] --version
# DESCRIPTION
-rg (ripgrep) combines the usability of The Silver Searcher (an ack clone) with
+ripgrep (rg) combines the usability of The Silver Searcher (an ack clone) with
the raw speed of grep.
+Project home page: https://github.com/BurntSushi/ripgrep
+
# COMMON OPTIONS
-a, --text
diff --git a/src/args.rs b/src/args.rs
index f75f331d..f66667a9 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -1,8 +1,9 @@
use std::env;
use std::io;
use std::path::{Path, PathBuf};
+use std::process;
-use docopt::Docopt;
+use docopt::{self, Docopt};
use env_logger;
use grep::{Grep, GrepBuilder};
use log;
@@ -38,7 +39,9 @@ Usage: rg [options] -e PATTERN ... [<path> ...]
rg [options] --help
rg [options] --version
-rg recursively searches your current directory for a regex pattern.
+ripgrep (rg) recursively searches your current directory for a regex pattern.
+
+Project home page: https://github.com/BurntSushi/ripgrep
Common options:
-a, --text Search binary files as if they were text.
@@ -538,7 +541,15 @@ impl Args {
let mut raw: RawArgs =
Docopt::new(USAGE)
.and_then(|d| d.argv(argv).version(Some(version())).decode())
- .unwrap_or_else(|e| e.exit());
+ .unwrap_or_else(|e| {
+ match e {
+ docopt::Error::Version(ref v) => {
+ println!("ripgrep {}", v);
+ process::exit(0);
+ }
+ e => e.exit(),
+ }
+ });
let mut logb = env_logger::LogBuilder::new();
if raw.flag_debug {