Giter Club home page Giter Club logo

Comments (6)

simonw avatar simonw commented on June 19, 2024

I'm going to support multiple ?glob= querystring arguments which will be passed to rg.

from datasette-ripgrep.

simonw avatar simonw commented on June 19, 2024
    -g, --glob <GLOB>...                    
            Include or exclude files and directories for searching that match the given
            glob. This always overrides any other ignore logic. Multiple glob flags may be
            used. Globbing rules match .gitignore globs. Precede a glob with a ! to exclude
            it. If multiple globs match a file or directory, the glob given later in the
            command line takes precedence.
            
            When this flag is set, every file and directory is applied to it to test for
            a match. So for example, if you only want to search in a particular directory
            'foo', then *-g foo* is incorrect because 'foo/bar' does not match the glob
            'foo'. Instead, you should use *-g 'foo/**'*.

from datasette-ripgrep.

simonw avatar simonw commented on June 19, 2024

I'm a bit confused about what is meant to happen if you pass -g multiple times.

Globs are interpreted in exactly the same way as .gitignore patterns. That is, later globs will override earlier globs. For example, the following command will search only *.toml files:

$ rg clap -g '!*.toml' -g '*.toml'

I was expecting these to act as "AND" rules - so -g '*.py' -g 'datasette/**' would return all .py files in my datasette/ directory. That doesn't appear to be happening - I get back results for all .py files ignoring whether they are inside datasette/ no matter which order I pass the -g flags in.

from datasette-ripgrep.

simonw avatar simonw commented on June 19, 2024

I'm going to support ?glob=&glob= in the querystring (as an advanced power user feature) but I'm not going to expose it in the UI, since it doesn't behave the way I expected it to.

from datasette-ripgrep.

simonw avatar simonw commented on June 19, 2024

Those new examples:

from datasette-ripgrep.

simonw avatar simonw commented on June 19, 2024

ripgrep__with__AsyncClient

from datasette-ripgrep.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.