From a744ec133d12e0c8d8e8b0486cd92e2b60ad61e6 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Thu, 8 Sep 2016 16:15:44 -0400 Subject: [PATCH] Rename xrep to ripgrep. --- Cargo.toml | 10 +++++----- appveyor.yml | 4 ++-- ci/before_deploy.sh | 2 +- ci/script.sh | 2 +- grep/Cargo.toml | 6 +++--- src/args.rs | 32 ++++++++++++++++---------------- src/gitignore.rs | 4 ++-- src/ignore.rs | 10 +++++----- src/sys.rs | 2 +- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3defad82..3bf5477e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,14 @@ [package] publish = false -name = "xrep" +name = "ripgrep" version = "0.1.0" #:version authors = ["Andrew Gallant "] description = """ Line oriented search tool using Rust's regex library. """ -documentation = "https://github.com/BurntSushi/xrep" -homepage = "https://github.com/BurntSushi/xrep" -repository = "https://github.com/BurntSushi/xrep" +documentation = "https://github.com/BurntSushi/ripgrep" +homepage = "https://github.com/BurntSushi/ripgrep" +repository = "https://github.com/BurntSushi/ripgrep" readme = "README.md" keywords = ["regex", "grep", "egrep", "search", "pattern"] license = "Unlicense/MIT" @@ -16,7 +16,7 @@ license = "Unlicense/MIT" [[bin]] bench = false path = "src/main.rs" -name = "xrep" +name = "rg" [dependencies] crossbeam = "0.2" diff --git a/appveyor.yml b/appveyor.yml index 4aa80369..c32649b1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ environment: global: - PROJECT_NAME: xrep + PROJECT_NAME: rg matrix: # Nightly channel - TARGET: i686-pc-windows-gnu @@ -39,7 +39,7 @@ before_deploy: # TODO(burntsushi): How can we enable SSSE3 on Windows? - cargo build --release - mkdir staging - - copy target\release\xrep.exe staging + - copy target\release\rg.exe staging - cd staging # release zipfile will look like 'rust-everywhere-v1.2.3-x86_64-pc-windows-msvc' - 7z a ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip * diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh index b18c9b61..40f66d81 100644 --- a/ci/before_deploy.sh +++ b/ci/before_deploy.sh @@ -16,7 +16,7 @@ mk_tarball() { # TODO update this part to copy the artifacts that make sense for your project # NOTE All Cargo build artifacts will be under the 'target/$TARGET/{debug,release}' - cp target/$TARGET/release/xrep $td + cp target/$TARGET/release/rg $td pushd $td diff --git a/ci/script.sh b/ci/script.sh index b93c686d..e8359816 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -42,7 +42,7 @@ run_test_suite() { cargo test --target $TARGET # sanity check the file type - file target/$TARGET/debug/xrep + file target/$TARGET/debug/rg } main() { diff --git a/grep/Cargo.toml b/grep/Cargo.toml index e01e688b..f84604ad 100644 --- a/grep/Cargo.toml +++ b/grep/Cargo.toml @@ -6,9 +6,9 @@ authors = ["Andrew Gallant "] description = """ Fast line oriented regex searching as a library. """ -documentation = "https://github.com/BurntSushi/xrep" -homepage = "https://github.com/BurntSushi/xrep" -repository = "https://github.com/BurntSushi/xrep" +documentation = "https://github.com/BurntSushi/ripgrep" +homepage = "https://github.com/BurntSushi/ripgrep" +repository = "https://github.com/BurntSushi/ripgrep" readme = "README.md" keywords = ["regex", "grep", "egrep", "search", "pattern"] license = "Unlicense/MIT" diff --git a/src/args.rs b/src/args.rs index de9ddcb8..7b363d00 100644 --- a/src/args.rs +++ b/src/args.rs @@ -28,13 +28,13 @@ use Result; /// If you've never heard of Docopt before, see: http://docopt.org /// (TL;DR: The CLI parser is generated from the usage string below.) const USAGE: &'static str = " -Usage: xrep [options] [ ...] - xrep [options] --files [ ...] - xrep [options] --type-list - xrep --help - xrep --version +Usage: rg [options] [ ...] + rg [options] --files [ ...] + rg [options] --type-list + rg --help + rg --version -xrep is like the silver searcher and grep, but faster than both. +rg combines the usability of the silver search with the raw speed of grep. Common options: -a, --text Search binary files as if they were text. @@ -114,14 +114,14 @@ Less common options: --mmap Search using memory maps when possible. This is enabled by default - when xrep thinks it will be faster. (Note that mmap searching doesn't - current support the various context related options.) + when ripgrep thinks it will be faster. (Note that mmap searching + doesn't current support the various context related options.) --no-mmap Never use memory maps, even when they might be faster. --no-ignore - Don't respect ignore files (.gitignore, .xrepignore, etc.) + Don't respect ignore files (.gitignore, .rgignore, etc.) --no-ignore-parent Don't respect ignore files in parent directories. @@ -137,7 +137,7 @@ Less common options: (capped at 6). [default: 0] --version - Show the version number of xrep and exit. + Show the version number of ripgrep and exit. File type management options: --type-list @@ -152,7 +152,7 @@ File type management options: "; /// RawArgs are the args as they are parsed from Docopt. They aren't used -/// directly by the rest of xrep. +/// directly by the rest of ripgrep. #[derive(Debug, RustcDecodable)] pub struct RawArgs { arg_pattern: String, @@ -230,7 +230,7 @@ pub struct Args { } impl RawArgs { - /// Convert arguments parsed into a configuration used by xrep. + /// Convert arguments parsed into a configuration used by ripgrep. fn to_args(&self) -> Result { let pattern = { let pattern = @@ -387,7 +387,7 @@ impl Args { /// /// If a CLI usage error occurred, then exit the process and print a usage /// or error message. Similarly, if the user requested the version of - /// xrep, then print the version and exit. + /// ripgrep, then print the version and exit. /// /// Also, initialize a global logger. pub fn parse() -> Result { @@ -409,7 +409,7 @@ impl Args { raw.to_args().map_err(From::from) } - /// Returns true if xrep should print the files it will search and exit + /// Returns true if ripgrep should print the files it will search and exit /// (but not do any actual searching). pub fn files(&self) -> bool { self.files @@ -518,8 +518,8 @@ impl Args { &self.type_defs } - /// Returns true if xrep should print the type definitions currently loaded - /// and then exit. + /// Returns true if ripgrep should print the type definitions currently + /// loaded and then exit. pub fn type_list(&self) -> bool { self.type_list } diff --git a/src/gitignore.rs b/src/gitignore.rs index 7ca693b9..fd8fd6f2 100644 --- a/src/gitignore.rs +++ b/src/gitignore.rs @@ -9,7 +9,7 @@ The motivation for this submodule is performance and portability: 2. We could shell out to a `git` sub-command like ls-files or status, but it seems better to not rely on the existence of external programs for a search tool. Besides, we need to implement this logic anyway to support things like - an .xrepignore file. + an .rgignore file. The key implementation detail here is that a single gitignore file is compiled into a single RegexSet, which can be used to report which globs match a @@ -379,7 +379,7 @@ mod tests { }; } - const ROOT: &'static str = "/home/foobar/rust/xrep"; + const ROOT: &'static str = "/home/foobar/rust/rg"; ignored!(ig1, ROOT, "months", "months"); ignored!(ig2, ROOT, "*.lock", "Cargo.lock"); diff --git a/src/ignore.rs b/src/ignore.rs index 550cbb8c..2b50d596 100644 --- a/src/ignore.rs +++ b/src/ignore.rs @@ -5,7 +5,7 @@ whether a *single* file path should be searched or not. In general, there are two ways to ignore a particular file: 1. Specify an ignore rule in some "global" configuration, such as a - $HOME/.xrepignore or on the command line. + $HOME/.rgignore or on the command line. 2. A specific ignore file (like .gitignore) found during directory traversal. The `IgnoreDir` type handles ignore patterns for any one particular directory @@ -24,7 +24,7 @@ use types::Types; const IGNORE_NAMES: &'static [&'static str] = &[ ".gitignore", ".agignore", - ".xrepignore", + ".rgignore", ]; /// Represents an error that can occur when parsing a gitignore file. @@ -257,8 +257,8 @@ pub struct IgnoreDir { /// A single accumulation of glob patterns for this directory, matched /// using gitignore semantics. /// - /// This will include patterns from xrepignore as well. The patterns are - /// ordered so that precedence applies automatically (e.g., xrepignore + /// This will include patterns from rgignore as well. The patterns are + /// ordered so that precedence applies automatically (e.g., rgignore /// patterns procede gitignore patterns). gi: Option, // TODO(burntsushi): Matching other types of glob patterns that don't @@ -422,7 +422,7 @@ mod tests { }; } - const ROOT: &'static str = "/home/foobar/rust/xrep"; + const ROOT: &'static str = "/home/foobar/rust/rg"; ignored_dir!(id1, ROOT, "src/main.rs", "", "src/main.rs"); ignored_dir!(id2, ROOT, "", "src/main.rs", "src/main.rs"); diff --git a/src/sys.rs b/src/sys.rs index 99009792..4f53039e 100644 --- a/src/sys.rs +++ b/src/sys.rs @@ -1,6 +1,6 @@ /*! This io module contains various platform specific functions for detecting -how xrep is being used. e.g., Is stdin being piped into it? Is stdout being +how ripgrep is being used. e.g., Is stdin being piped into it? Is stdout being redirected to a file? etc... We use this information to tweak various default configuration parameters such as colors and match formatting. */