Giter Club home page Giter Club logo

Comments (4)

fennewald avatar fennewald commented on June 6, 2024

looking into the golang file watching ecosystem, it seems the list of events above is likely more verbose than needed.

I plan on using fsnotify, which means this will be cross-platform, but will only support Create, Write, Rename, Remove, Chmod events

from elvish.

xiaq avatar xiaq commented on June 6, 2024

Regarding the design itself:

  • There's precedent in accepting duration strings (as accepted by time.ParseDuration) in sleep.

  • There's no precedent in outputting timestamps though. It should probably be another basic data type, like numbers.

  • debounce can be a general-purpose command, so you'd do something like watch ... | debounce 1s.

But...

However, developing the behavior above as a separate command, that implements all the logic defined above, and simply outputs json, could be wrapped relatively easily by elvish, and might make more sense than an addition to the stdlib.

I agree with this :) Developing a command that is based on fsnotify and outputs JSON makes a lot of sense.

I do like the idea of having this well integrated into Elvish - the output is structured, so it's quite clumsy in traditional shells but very easy in Elvish. If you'd like to build an Elvish module that wraps it, that's something I'm thinking about in #1607 (case 3).

from elvish.

fennewald avatar fennewald commented on June 6, 2024

Makes sense :). I have a few thoughts about #1607 I'll leave there.

from elvish.

krader1961 avatar krader1961 commented on June 6, 2024

Note that there is no reason this needs to be limited to working on Linux. The fswatch command shows that it is possible to support Linux, the various BSDs (including macOS), and Windows. In fact, if you're going to write a module that wraps an external command to make using the external command easier to use with Elvish I would argue that fswatch is a better choice given that it also works on all the platforms supported by Elvish.

from elvish.

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.