diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-05-11 22:10:33 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-05-11 22:10:33 +0200 |
commit | 649c2db308f16ce4b2cbefe4a8760577541cfb47 (patch) | |
tree | da14efc1d5f271c6b232c1299f7459f810ac80c6 /src/nix/flake.cc | |
parent | 27d34ef770356f86823ca832f278e72bb0a07982 (diff) |
nix flake: Add completion support
Diffstat (limited to 'src/nix/flake.cc')
-rw-r--r-- | src/nix/flake.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nix/flake.cc b/src/nix/flake.cc index 6eee781aa..b6cc7eb54 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -28,7 +28,14 @@ public: FlakeCommand() { - expectArg("flake-url", &flakeUrl, true); + expectArgs({ + .label = "flake-url", + .optional = true, + .handler = {&flakeUrl}, + .completer = {[&](size_t, std::string_view prefix) { + completeFlakeRef(prefix); + }} + }); } FlakeRef getFlakeRef() |