A simple command-line tool to take notes on the file-system.
There is a bunch of useful commands:
nfs-see, to watch the notes taken on a filenfs-take, to take notes on a filenfs-edit, to change the notes of a file
There is also a repl (nfs-repl command) which have all the commands in Commands section with a more pleasant syntax.
Moreover, the repl is lazy by default, in the sense that the changes made by the user aren't immediately committed to the
file-system, but they are maintained in a cache. When the user exits the repl or runs the commit command, the changes
are written to the file system. This is done for a better efficiency, but it is recommended not to have multiple sessions
of the repl, since it can bring to (deliberately unhandled) race conditions.
note-fs has some dependencies:
- Haskell language, since the tool is actually written in Haskell;
- stack build system;
hs-utilslibrary, available here;optparse-applicative, available here;aeson, available here;
Contributions are welcomed, so feel free to start a pull request or to open an issue! Anyway, if you want to implement a new command, you can follow these quite simple procedures:
- Add a new command op-code in the type
Command, insrc/Commands.hssource; - Add the new lexical tokens in
src/Commands/Lexer.hssource, one for the executable command and one for the repl command; - Implement a parser in
src/Commands/Parsing.hssource for your command, see the precise guidelines directly in the source; - Write an implementation of your command in
src/Commands/Impl.hsand update therunCommandfunction. For the functionalities you want to implement, you can exploit facilities insrc/Env.hs; - (Optional) If you want to have a new executable, add a new function in
src/Programs.hswith the name of your command. As implementation, it should be enough evaluating theexecCommandfunction. Then:- Create a new file in the
appfolder,import Programsand write amainwhere you evaluate your command function; - Update
package.yaml, adding the executable in theexecutablessection. Be aware that the name of the executable MUST be equal to the name of executable you gave in the lexer (this is quite bad, so this is a TODO).
- Create a new file in the
GPL-3