mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-31 20:21:59 -07:00
Compare commits
14 Commits
wincolor-0
...
termcolor-
Author | SHA1 | Date | |
---|---|---|---|
|
2f3a8c7f69 | ||
|
3ac1b68e54 | ||
|
0ebd5465b7 | ||
|
5cb4bb9ea0 | ||
|
c8a179b4da | ||
|
46f94826fd | ||
|
75f1855a91 | ||
|
fd9870d668 | ||
|
a3a2708067 | ||
|
78847b65c8 | ||
|
e962eea1cc | ||
|
95bc678403 | ||
|
68af3bbdc4 | ||
|
70b6bdb104 |
62
CHANGELOG.md
62
CHANGELOG.md
@@ -1,3 +1,65 @@
|
||||
0.5.0 (2017-03-12)
|
||||
==================
|
||||
This is a new minor version release of ripgrep that includes one minor breaking
|
||||
change, bug fixes and several new features including support for text encodings
|
||||
other than UTF-8.
|
||||
|
||||
A notable accomplishment with respect to Rust is that ripgrep proper now only
|
||||
contains a single `unsafe` use (for accessing the contents of a memory map).
|
||||
|
||||
The **breaking change** is:
|
||||
|
||||
* [FEATURE #380](https://github.com/BurntSushi/ripgrep/issues/380):
|
||||
Line numbers are now hidden by default when ripgrep is printing to a tty
|
||||
**and** the only thing searched is stdin.
|
||||
|
||||
Feature enhancements:
|
||||
|
||||
* Added or improved file type filtering for Ceylon, CSS, Elixir, HTML, log,
|
||||
SASS, SVG, Twig
|
||||
* [FEATURE #1](https://github.com/BurntSushi/ripgrep/issues/1):
|
||||
Add support for additional text encodings, including automatic detection for
|
||||
UTF-16 via BOM sniffing. Explicit text encoding support with the
|
||||
`-E/--encoding` flag was also added for latin-1, GBK, EUC-JP
|
||||
and Shift_JIS, among others. The full list can be found here:
|
||||
https://encoding.spec.whatwg.org/#concept-encoding-get
|
||||
* [FEATURE #129](https://github.com/BurntSushi/ripgrep/issues/129):
|
||||
Add a new `-M/--max-columns` flag that omits lines longer than the given
|
||||
number of bytes. (Disabled by default!)
|
||||
* [FEATURE #369](https://github.com/BurntSushi/ripgrep/issues/369):
|
||||
A new flag, `--max-filesize`, was added for limiting searches to files with
|
||||
a maximum file size.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* [BUG #52](https://github.com/BurntSushi/ripgrep/issues/52),
|
||||
[BUG #311](https://github.com/BurntSushi/ripgrep/issues/311):
|
||||
Tweak how binary files are detected and handled. (We are slightly less
|
||||
conservative and will no longer use memory without bound.)
|
||||
* [BUG #326](https://github.com/BurntSushi/ripgrep/issues/326):
|
||||
When --files flag is given, we should never attempt to parse positional
|
||||
arguments as regexes.
|
||||
* [BUG #327](https://github.com/BurntSushi/ripgrep/issues/327):
|
||||
Permit the --heading flag to override the --no-heading flag.
|
||||
* [BUG #340](https://github.com/BurntSushi/ripgrep/pull/340):
|
||||
Clarify that the `-u/--unrestricted` flags are aliases.
|
||||
* [BUG #343](https://github.com/BurntSushi/ripgrep/pull/343):
|
||||
Global git ignore config should use `$HOME/.config/git/ignore` and not
|
||||
`$HOME/git/ignore`.
|
||||
* [BUG #345](https://github.com/BurntSushi/ripgrep/pull/345):
|
||||
Clarify docs for `-g/--glob` flag.
|
||||
* [BUG #381](https://github.com/BurntSushi/ripgrep/issues/381):
|
||||
Add license files to each sub-crate.
|
||||
* [BUG #383](https://github.com/BurntSushi/ripgrep/issues/383):
|
||||
Use latest version of clap (for argv parsing).
|
||||
* [BUG #392](https://github.com/BurntSushi/ripgrep/issues/391):
|
||||
Fix translation of set globs (e.g., `{foo,bar,quux}`) to regexes.
|
||||
* [BUG #401](https://github.com/BurntSushi/ripgrep/pull/401):
|
||||
Add PowerShell completion file to Windows release.
|
||||
* [BUG #405](https://github.com/BurntSushi/ripgrep/issues/405):
|
||||
Fix bug when excluding absolute paths with the `-g/--glob` flag.
|
||||
|
||||
|
||||
0.4.0
|
||||
=====
|
||||
This is a new minor version release of ripgrep that includes a couple very
|
||||
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1,6 +1,6 @@
|
||||
[root]
|
||||
name = "ripgrep"
|
||||
version = "0.4.0"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bytecount 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ripgrep"
|
||||
version = "0.4.0" #:version
|
||||
version = "0.5.0" #:version
|
||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||
description = """
|
||||
Line oriented search tool using Rust's regex library. Combines the raw
|
||||
|
13
README.md
13
README.md
@@ -13,6 +13,10 @@ downloads available for
|
||||
|
||||
Dual-licensed under MIT or the [UNLICENSE](http://unlicense.org).
|
||||
|
||||
### CHANGELOG
|
||||
|
||||
Please see the [CHANGELOG](CHANGELOG.md) for a release history.
|
||||
|
||||
### Screenshot of search results
|
||||
|
||||
[](http://burntsushi.net/stuff/ripgrep1.png)
|
||||
@@ -226,11 +230,10 @@ colorize your output and show line numbers, just like The Silver Searcher.
|
||||
Coloring works on Windows too! Colors can be controlled more granularly with
|
||||
the `--color` flag.
|
||||
|
||||
One last thing before we get started: `ripgrep` assumes UTF-8 *everywhere*. It
|
||||
can still search files that are invalid UTF-8 (like, say, latin-1), but it will
|
||||
simply not work on UTF-16 encoded files or other more exotic encodings.
|
||||
[Support for other encodings may
|
||||
happen.](https://github.com/BurntSushi/ripgrep/issues/1)
|
||||
One last thing before we get started: generally speaking, `ripgrep` assumes the
|
||||
input is reading is UTF-8. However, if ripgrep notices a file is encoded as
|
||||
UTF-16, then it will know how to search it. For other encodings, you'll need to
|
||||
explicitly specify them with the `-E/--encoding` flag.
|
||||
|
||||
To recursively search the current directory, while respecting all `.gitignore`
|
||||
files, ignore hidden files and directories and skip binary files:
|
||||
|
@@ -40,7 +40,7 @@ before_deploy:
|
||||
- cargo build --release
|
||||
- mkdir staging
|
||||
- copy target\release\rg.exe staging
|
||||
- copy target\release\build\ripgrep-*\out\_rg.ps1 staging
|
||||
- ps: copy target\release\build\ripgrep-*\out\_rg.ps1 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 *
|
||||
|
@@ -1,16 +1,16 @@
|
||||
class RipgrepBin < Formula
|
||||
version '0.4.0'
|
||||
version '0.5.0'
|
||||
desc "Search tool like grep and The Silver Searcher."
|
||||
homepage "https://github.com/BurntSushi/ripgrep"
|
||||
url "https://github.com/BurntSushi/ripgrep/releases/download/#{version}/ripgrep-#{version}-x86_64-apple-darwin.tar.gz"
|
||||
sha256 "6ac71251909227f8ef7eda27d3080c954843f3665b81e455362c90b2a9c4734a"
|
||||
sha256 "5bfa8872c4f2a5d010ddec1c213d518056e62d4dd3b3f23a0ef099b85343dbdd"
|
||||
|
||||
conflicts_with "ripgrep"
|
||||
|
||||
def install
|
||||
bin.install "rg"
|
||||
man1.install "rg.1"
|
||||
|
||||
|
||||
bash_completion.install "complete/rg.bash-completion"
|
||||
fish_completion.install "complete/rg.fish"
|
||||
zsh_completion.install "complete/_rg"
|
||||
|
@@ -68,12 +68,12 @@ fn app<F>(next_line_help: bool, doc: F) -> App<'static, 'static>
|
||||
// consistent with short/long views.
|
||||
.arg(arg("help-short").short("h"))
|
||||
.arg(flag("help"))
|
||||
.arg(flag("version").short("V"))
|
||||
.arg(arg("ripgrep-version").long("version").short("V"))
|
||||
// First, set up primary positional/flag arguments.
|
||||
.arg(arg("pattern")
|
||||
.required_unless_one(&[
|
||||
"file", "files", "help-short", "help", "regexp", "type-list",
|
||||
"version",
|
||||
"ripgrep-version",
|
||||
]))
|
||||
.arg(arg("path").multiple(true))
|
||||
.arg(flag("regexp").short("e")
|
||||
@@ -206,7 +206,7 @@ lazy_static! {
|
||||
doc!(h, "help",
|
||||
"Show verbose help output.",
|
||||
"When given, more details about flags are provided.");
|
||||
doc!(h, "version",
|
||||
doc!(h, "ripgrep-version",
|
||||
"Prints version information.");
|
||||
|
||||
doc!(h, "pattern",
|
||||
|
19
src/args.rs
19
src/args.rs
@@ -88,18 +88,23 @@ impl Args {
|
||||
///
|
||||
/// Also, initialize a global logger.
|
||||
pub fn parse() -> Result<Args> {
|
||||
let matches = app::app_short().get_matches();
|
||||
use clap::ErrorKind::*;
|
||||
|
||||
let matches = match app::app_short().get_matches_safe() {
|
||||
Ok(matches) => matches,
|
||||
Err(clap::Error { kind: HelpDisplayed, .. }) => {
|
||||
let _ = ::app::app_long().print_help();
|
||||
println!("");
|
||||
process::exit(0);
|
||||
}
|
||||
Err(err) => err.exit(),
|
||||
};
|
||||
if matches.is_present("help-short") {
|
||||
let _ = ::app::app_short().print_help();
|
||||
println!("");
|
||||
process::exit(0);
|
||||
}
|
||||
if matches.is_present("help") {
|
||||
let _ = ::app::app_long().print_help();
|
||||
println!("");
|
||||
process::exit(0);
|
||||
}
|
||||
if matches.is_present("version") {
|
||||
if matches.is_present("ripgrep-version") {
|
||||
println!("ripgrep {}", crate_version!());
|
||||
process::exit(0);
|
||||
}
|
||||
|
@@ -1,5 +1,3 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use std::cmp;
|
||||
use std::io::{self, Read};
|
||||
|
||||
@@ -290,10 +288,6 @@ mod tests {
|
||||
|
||||
use super::{Bom, BomPeeker, DecodeReader};
|
||||
|
||||
fn utf8(bytes: &[u8]) -> &str {
|
||||
::std::str::from_utf8(bytes).unwrap()
|
||||
}
|
||||
|
||||
fn read_to_string<R: Read>(mut rdr: R) -> String {
|
||||
let mut s = String::new();
|
||||
rdr.read_to_string(&mut s).unwrap();
|
||||
|
3
termcolor/COPYING
Normal file
3
termcolor/COPYING
Normal file
@@ -0,0 +1,3 @@
|
||||
This project is dual-licensed under the Unlicense and MIT licenses.
|
||||
|
||||
You may use this code under the terms of either license.
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "termcolor"
|
||||
version = "0.3.1" #:version
|
||||
version = "0.3.2" #:version
|
||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||
description = """
|
||||
A simple cross platform library for writing colored text to a terminal.
|
||||
|
21
termcolor/LICENSE-MIT
Normal file
21
termcolor/LICENSE-MIT
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Andrew Gallant
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
24
termcolor/UNLICENSE
Normal file
24
termcolor/UNLICENSE
Normal file
@@ -0,0 +1,24 @@
|
||||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <http://unlicense.org/>
|
Reference in New Issue
Block a user