Giter Club home page Giter Club logo

Comments (2)

henrycatalinismith avatar henrycatalinismith commented on July 26, 2024

I like this idea a lot, thanks for suggesting it :)

I'll make it happen.

from ppl.

henrycatalinismith avatar henrycatalinismith commented on July 26, 2024

When I sat down to build this, I began to envision a number of problems with building my own DIY search system.

  • If the search string is present among the attributes of the contact, but isn't present in the output of ppl ls, should that contact be displayed in the output of the search?
  • If the answer to the question above is "yes", do I write some sort of algorithm that cleverly determines which attributes to include in the output based on which ones match the search?
  • Otherwise, do I implement a whole bunch of option flags for users to control the search space of their searches so that there can be no unintended matches?

Besides that, parsing every single contact's vCard and iterating through and examining them all seems like something that isn't going to increase ppl's already underwhelming speed.

So I've gone the simple route, and added a command called ppl grep. This command does almost nothing for itself, instead simply delegating all your input options and arguments to git grep. There are several benefits with this approach:

  • git grep is orders of magnitude faster than anything I could ever hope to implement myself.
  • Output always includes the matching line, making it clear which piece of contact data matched your search string
  • Regular expression searching is possible without me having to build anything
  • Case-sensitivity is optional, again without requiring any work on my part
  • Output is paged if it exceeds screen height

I know this isn't exactly what you asked for, but it's an approach that gives you the maximum performance and flexibility with the minimum possible development time on my part, so it was too good an option for me to pass up. I hope it meets your needs!

from ppl.

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.