Comments (4)
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.
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 likewatch ... | 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.
Makes sense :). I have a few thoughts about #1607 I'll leave there.
from elvish.
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)
- clarify the difference between `math:floor` and `math:trunc`
- Rpmlint reported `elvish.x86_64: E: readelf-failed /usr/bin/elvish 'utf-8' codec can't decode byte 0xc2 in position 7599: invalid continuation byte` when building on Fedora HOT 2
- gdb not working inside elvish HOT 10
- Support the kitty keyboard protocol
- Mapping `$edit:close-mode~` has no effect HOT 10
- `edit:complete-filename` call without arguments crashes elvish HOT 1
- Unique symbols HOT 1
- Disable flow control by default HOT 1
- vscode-neovim doesn't work with Elvish as default shell HOT 15
- Race condition when starting multiple instances simultaneously HOT 2
- RSS support for the blog
- Support semantic prompts (OSC 133)
- Directory Elvish is launched from doesn't seem to be added to location history HOT 10
- Docs for embedding Elvish? HOT 3
- RISC-V binaries HOT 1
- [Question] Quoting strings to pass to external commands? HOT 6
- API to change the in-command colours? HOT 2
- Cursor and prompt control in function to avoid prompt flick HOT 9
- document and change behavior of `doc:find` with no arguments
- Indexing into a list of maps
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elvish.