Skip to content

Commit

Permalink
Add plugin command support for nix repl
Browse files Browse the repository at this point in the history
- Refactor the repl core into libexpr
- Use dependency injection via std::function to provide the completion
  functions from editline so we don't introduce extra dependencies for
  libexpr
- Add a RegisterReplCmd analogous to RegisterPrimOp for repl commands
- Refactor: get rid of the "ugly" global curRepl and replace it with a
  trick with closures on the nix side (that are effectively globals, but
  unique per repl user and thus not as ugly ;p)
- Rip out readline support since there appears to be no build system
  support for it and it is thus dead code
- Integration test this new plugin functionality
- Document it
  • Loading branch information
lf- committed Aug 15, 2020
1 parent 13e49be commit 296943a
Show file tree
Hide file tree
Showing 13 changed files with 846 additions and 693 deletions.
4 changes: 2 additions & 2 deletions doc/manual/command-ref/conf-file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,8 @@ password <replaceable>my-password</replaceable>
plugins may construct static instances of RegisterPrimOp to
add new primops or constants to the expression language,
RegisterStoreImplementation to add new store implementations,
RegisterCommand to add new subcommands to the
<literal>nix</literal> command, and RegisterSetting to add new
RegisterReplCmd to add new commands to the
<literal>nix</literal> REPL, and RegisterSetting to add new
nix config settings. See the constructors for those types for
more details.
</para>
Expand Down
Loading

0 comments on commit 296943a

Please sign in to comment.