Git Product home page Git Product logo

Comments (3)

davidledwards avatar davidledwards commented on August 30, 2024

Good idea. This may also be useful in other commands. What about introducing a find command with a limited set of operations that could be applied?

For example, to recursively find and remove all nodes whose name begins with foo starting at the path /bar:

find -r foo.* /bar --rm

The implication with --rm is that --force would be implied because it seems impractical to add a conditional version check. I could be wrong here, but that is my intuition.

General syntax of find would be:

usage: find [OPTIONS] PATTERN [PATH] [COMMAND]

PATTERN is a regular expression, either very basic syntax or strictly according to the JDK. PATH is an optional starting path, which defaults to pwd. COMMAND would be a limited set of commands that make sense to apply, where something like --print is the default.

from zookeeper.

mkwhitacre avatar mkwhitacre commented on August 30, 2024

Additional features like find would definitely be good. I'd also suggest having a "verbose" option or inversely "quiet" on the find command such that a consumer can more easily find out what the find command is actually doing (which nodes did it match on such that it is removing them?).

from zookeeper.

davidledwards avatar davidledwards commented on August 30, 2024

Finished adding support for find command. You can get help with zk --help find. There are also several examples in the README.

Note that this version only supports strict regular expressions as defined by Java 1.6, which means patterns you might expect to work like foo* must be expressed as foo.*. I might add simple pattern matching if this becomes too much of a burden for users.

https://github.com/davidledwards/zookeeper/tree/release-1.3

from zookeeper.

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.