35+ results for 'ripgrep lang:rust' (0 ms)

Not the results you expected?

05_ripgrep.rs (https://github.com/chromium/chromium.git) Rust · 952 lines

2 // args

3 //

4 // CLI used is adapted from ripgrep 48a8a3a691220f9e5b2b08f4051abe8655ea7e8a

5

6 use clap::{Arg, Command};

241

242 const ABOUT: &str = "

243 ripgrep (rg) recursively searches your current directory for a regex pattern.

244

245 ripgrep's regex engine uses finite automata and guarantees linear time

247 lookaround are not supported.

248

249 Project home page: https://github.com/BurntSushi/ripgrep

250

251 Use -h for short descriptions and --help for more details.";

_05_ripgrep.rs (https://github.com/anp/lolbench.git) Rust · 783 lines

2 // args

3 //

4 // CLI used is adapted from ripgrep 48a8a3a691220f9e5b2b08f4051abe8655ea7e8a

5

6 use clap::{App, AppSettings, Arg, ArgSettings};

10

11 wrap_libtest! {

12 _05_ripgrep,

13 fn build_app_short(b: &mut Bencher) { b.iter(|| app_short()); }

14 }

15

16 wrap_libtest! {

17 _05_ripgrep,

18 fn build_app_long(b: &mut Bencher) { b.iter(|| app_long()); }

19 }

lib.rs (https://github.com/liuchengxu/vim-clap.git) Rust · 144 lines

78 }

79

80 /// Prepend an icon to the output line of ripgrep.

81 pub fn prepend_grep_icon(line: &str) -> String {

82 format!("{} {}", grep_icon_for(line), line)

pipe.rs (https://github.com/phiresky/ripgrep-all.git) Rust · 196 lines

14 //! use std::io::{Read, Write};

15 //!

16 //! let (mut read, mut write) = ripgrep_all::pipe::pipe();

17 //!

18 //! let message = "Hello, world!";

main.rs (https://github.com/Manishearth/oreutils.git) Rust · 187 lines

13 )]

14 enum Opt {

15 #[structopt(about = "Install the basic utilities: ripgrep, exa, bat, fd")]

16 Install {

17 #[structopt(help = "Specific tool to install. Omit to install all.")]

44 const TOOLS: &[Tool] = &[

45 Tool {

46 name: "ripgrep",

47 package: "ripgrep",

misc.rs (git://github.com/fosskers/aura.git) Rust · 36 lines

9 const LESS: &str = "/bin/less";

10

11 /// Expected location of the `ripgrep` executable.

12 const RIPGREP: &str = "/bin/rg";

28 /// arguments needed to affect the exact output.

29 pub(crate) fn searcher() -> (&'static str, &'static [&'static str]) {

30 let rg = Path::new(RIPGREP);

31 if rg.exists() {

32 (RIPGREP, &["-N"])

rga-fzf.rs (https://github.com/phiresky/ripgrep-all.git) Rust · 64 lines

1 use anyhow::Context;

2 use rga::adapters::spawning::map_exe_error;

3 use ripgrep_all as rga;

4

5 use std::process::{Command, Stdio};

rga-preproc.rs (https://github.com/phiresky/ripgrep-all.git) Rust · 38 lines

2 use rga::preproc::*;

3 use rga::print_dur;

4 use ripgrep_all as rga;

5

6 use anyhow::Context;

lib.rs (https://github.com/phiresky/ripgrep-all.git) Rust · 70 lines

19

20 pub fn project_dirs() -> Result<ProjectDirs> {

21 directories_next::ProjectDirs::from("", "", "ripgrep-all")

22 .context("no home directory found! :(")

23 }

logger.rs (https://github.com/gnzlbg/cargo-asm.git) Rust · 71 lines

1 // This logger has been adapted from ripgrep:

2 // https://github.com/BurntSushi/ripgrep

app.rs (https://github.com/liuchengxu/vim-clap.git) Rust · 112 lines

36 #[structopt(name = "ripgrep-forerunner")]

37 RipGrepForerunner(crate::cmd::grep::RipGrepForerunner),

38 /// Retrive the latest remote release info.

39 #[structopt(name = "upgrade")]

94 blines.run(self.number, self.winwidth)?;

95 }

96 Cmd::RipGrepForerunner(rip_grep_forerunner) => {

97 rip_grep_forerunner.run(self.number, self.icon_painter, self.no_cache)?

98 }

templates.rs (https://github.com/RustRPM/cargo-rpm.git) Rust · 137 lines

24 #[derive(Serialize)]

25 pub struct SpecParams {

26 /// Name of the RPM, sans ".rpm", e.g. "ripgrep"

27 pub name: String,

28

main.rs (https://bitbucket.org/sailfish009/rust.git) Rust · 139 lines

21 },

22 Test {

23 name: "ripgrep",

24 repo: "https://github.com/BurntSushi/ripgrep",

05-ripgrep-parse-lots.rs (https://github.com/anp/lolbench.git) Rust · 4 lines

2 lolbench_support :: { criterion_from_env , init_logging } ; fn main ( ) {

3 init_logging ( ) ; let mut crit = criterion_from_env ( ) ; clap_2_31_2 ::

4 _05_ripgrep :: parse_lots ( & mut crit ) ; }

05-ripgrep-build-help-short.rs (https://github.com/anp/lolbench.git) Rust · 4 lines

2 lolbench_support :: { criterion_from_env , init_logging } ; fn main ( ) {

3 init_logging ( ) ; let mut crit = criterion_from_env ( ) ; clap_2_31_2 ::

4 _05_ripgrep :: build_help_short ( & mut crit ) ; }

05-ripgrep-build-help-long.rs (https://github.com/anp/lolbench.git) Rust · 4 lines

2 lolbench_support :: { criterion_from_env , init_logging } ; fn main ( ) {

3 init_logging ( ) ; let mut crit = criterion_from_env ( ) ; clap_2_31_2 ::

4 _05_ripgrep :: build_help_long ( & mut crit ) ; }

05-ripgrep-build-app-short.rs (https://github.com/anp/lolbench.git) Rust · 4 lines

2 lolbench_support :: { criterion_from_env , init_logging } ; fn main ( ) {

3 init_logging ( ) ; let mut crit = criterion_from_env ( ) ; clap_2_31_2 ::

4 _05_ripgrep :: build_app_short ( & mut crit ) ; }

lib.rs (https://github.com/anp/lolbench.git) Rust · 15 lines

12 pub mod _03_complex;

13 pub mod _04_new_help;

14 pub mod _05_ripgrep;

15 pub mod _06_rustup;

16

05-ripgrep-parse-complex.rs (https://github.com/anp/lolbench.git) Rust · 4 lines

2 lolbench_support :: { criterion_from_env , init_logging } ; fn main ( ) {

3 init_logging ( ) ; let mut crit = criterion_from_env ( ) ; clap_2_31_2 ::

4 _05_ripgrep :: parse_complex ( & mut crit ) ; }

05-ripgrep-parse-clean.rs (https://github.com/anp/lolbench.git) Rust · 4 lines

2 lolbench_support :: { criterion_from_env , init_logging } ; fn main ( ) {

3 init_logging ( ) ; let mut crit = criterion_from_env ( ) ; clap_2_31_2 ::

4 _05_ripgrep :: parse_clean ( & mut crit ) ; }

05-ripgrep-build-app-long.rs (https://github.com/anp/lolbench.git) Rust · 4 lines

2 lolbench_support :: { criterion_from_env , init_logging } ; fn main ( ) {

3 init_logging ( ) ; let mut crit = criterion_from_env ( ) ; clap_2_31_2 ::

4 _05_ripgrep :: build_app_long ( & mut crit ) ; }

05-ripgrep-parse-lots.rs (https://github.com/anp/lolbench.git) Rust · 3 lines

1 extern crate lolbench ; # [ test ] fn end_to_end ( ) {

2 lolbench :: end_to_end_test ( "clap_2_31_2" , "_05_ripgrep::parse_lots" , ) ;

3 }

05-ripgrep-parse-complex.rs (https://github.com/anp/lolbench.git) Rust · 3 lines

1 extern crate lolbench ; # [ test ] fn end_to_end ( ) {

2 lolbench :: end_to_end_test ( "clap_2_31_2" , "_05_ripgrep::parse_complex" , )

3 ; }

05-ripgrep-parse-clean.rs (https://github.com/anp/lolbench.git) Rust · 3 lines

1 extern crate lolbench ; # [ test ] fn end_to_end ( ) {

2 lolbench :: end_to_end_test ( "clap_2_31_2" , "_05_ripgrep::parse_clean" , ) ;

3 }

05-ripgrep-build-help-short.rs (https://github.com/anp/lolbench.git) Rust · 3 lines

1 extern crate lolbench ; # [ test ] fn end_to_end ( ) {

2 lolbench :: end_to_end_test (

3 "clap_2_31_2" , "_05_ripgrep::build_help_short" , ) ; }

05-ripgrep-build-help-long.rs (https://github.com/anp/lolbench.git) Rust · 3 lines

1 extern crate lolbench ; # [ test ] fn end_to_end ( ) {

2 lolbench :: end_to_end_test ( "clap_2_31_2" , "_05_ripgrep::build_help_long" ,

3 ) ; }

05-ripgrep-build-app-short.rs (https://github.com/anp/lolbench.git) Rust · 3 lines

1 extern crate lolbench ; # [ test ] fn end_to_end ( ) {

2 lolbench :: end_to_end_test ( "clap_2_31_2" , "_05_ripgrep::build_app_short" ,

3 ) ; }

05-ripgrep-build-app-long.rs (https://github.com/anp/lolbench.git) Rust · 3 lines

1 extern crate lolbench ; # [ test ] fn end_to_end ( ) {

2 lolbench :: end_to_end_test ( "clap_2_31_2" , "_05_ripgrep::build_app_long" ,

3 ) ; }

tests.rs (https://github.com/BurntSushi/ripgrep.git) Rust · 22 lines

8 mod util;

9

10 // Tests for ripgrep's handling of binary files.

11 mod binary;

12 // Tests related to most features in ripgrep. If you're adding something new

13 // to ripgrep, tests should probably go in here.

14 mod feature;

15 // Tests for ripgrep's JSON format.

17 // Miscellaneous tests grouped in a haphazard manner. Try not to add more.

18 mod misc;

19 // Tests for ripgrep's multiline search support.

20 mod multiline;

21 // Regression tests.

lib.rs (https://github.com/BurntSushi/ripgrep.git) Rust · 23 lines

1 /*!

2 ripgrep, as a library.

3

4 This library is intended to provide a high level facade to the crates that

5 make up ripgrep's core searching routines. However, there is no high level

6 documentation available yet guiding users on how to fit all of the pieces

7 together.

config.rs (https://github.com/BurntSushi/ripgrep.git) Rust · 169 lines

1 // This module provides routines for reading ripgrep config "rc" files. The

2 // primary output of these routines is a sequence of arguments, where each

3 // argument corresponds precisely to one shell argument.

15 use crate::Result;

16

17 /// Return a sequence of arguments derived from ripgrep rc configuration files.

18 pub fn args() -> Vec<OsString> {

19 let config_path = match env::var_os("RIPGREP_CONFIG_PATH") {

46 }

47

48 /// Parse a single ripgrep rc file from the given path.

49 ///

50 /// On success, this returns a set of shell arguments, in order, that should

51 /// be pre-pended to the arguments given to ripgrep at the command line.

52 ///

53 /// If the file could not be read, then an error is returned. If there was

messages.rs (https://github.com/BurntSushi/ripgrep.git) Rust · 74 lines

15 }

16

17 /// Like message, but sets ripgrep's "errored" flag, which controls the exit

18 /// status.

19 #[macro_export]

64 }

65

66 /// Returns true if and only if ripgrep came across a non-fatal error.

67 pub fn errored() -> bool {

68 ERRORED.load(Ordering::SeqCst)

69 }

70

71 /// Indicate that ripgrep has come across a non-fatal error.

72 pub fn set_errored() {

73 ERRORED.store(true, Ordering::SeqCst);

bench.rs (https://github.com/BurntSushi/ripgrep.git) Rust · 116 lines

1 /*!

2 This module benchmarks the glob implementation. For benchmarks on the ripgrep

3 tool itself, see the benchsuite directory.

4 */

subject.rs (https://github.com/BurntSushi/ripgrep.git) Rust · 160 lines

62 }

63 // At this point, we only want to search something if it's explicitly a

64 // file. This omits symlinks. (If ripgrep was configured to follow

65 // symlinks, then they have already been followed by the directory

66 // traversal.)

126 /// an explicit subject, but, e.g., `./some-dir/some-other-file` is not.

127 ///

128 /// However, note that ripgrep does not see through shell globbing. e.g.,

129 /// in `rg foo ./some-dir/*`, `./some-dir/some-other-file` will be treated

130 /// as an explicit subject.

05_ripgrep.rs (https://github.com/kbknapp/clap-rs.git) Rust · 953 lines

2 // args

3 //

4 // CLI used is adapted from ripgrep 48a8a3a691220f9e5b2b08f4051abe8655ea7e8a

5

6 use clap::{App, AppSettings, Arg, ArgSettings};

241

242 const ABOUT: &str = "

243 ripgrep (rg) recursively searches your current directory for a regex pattern.

244

245 ripgrep's regex engine uses finite automata and guarantees linear time

247 lookaround are not supported.

248

249 Project home page: https://github.com/BurntSushi/ripgrep

250

251 Use -h for short descriptions and --help for more details.";