aboutsummaryrefslogtreecommitdiff
path: root/src/nix/flake.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-05-11 22:10:33 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-05-11 22:10:33 +0200
commit649c2db308f16ce4b2cbefe4a8760577541cfb47 (patch)
treeda14efc1d5f271c6b232c1299f7459f810ac80c6 /src/nix/flake.cc
parent27d34ef770356f86823ca832f278e72bb0a07982 (diff)
nix flake: Add completion support
Diffstat (limited to 'src/nix/flake.cc')
-rw-r--r--src/nix/flake.cc9
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()