diff options
author | Tom Bereknyei <tomberek@gmail.com> | 2022-02-18 18:33:03 -0500 |
---|---|---|
committer | Tom Bereknyei <tomberek@gmail.com> | 2022-05-18 21:20:59 -0400 |
commit | 81567a096258026148b42f3048be9b2ba295b41a (patch) | |
tree | bbade067243ae6a2e79cd221c0a8e9f4d4331ce7 /src/libcmd | |
parent | 06d57ce7597fc1b49ce1cdc721edc64eaafe38fb (diff) |
repl: allow loading installables from CLI
repl: search installable with findAlongAttrPath
repl: refactor handling of args
repl: temp
Diffstat (limited to 'src/libcmd')
-rw-r--r-- | src/libcmd/command.hh | 1 | ||||
-rw-r--r-- | src/libcmd/installables.cc | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/libcmd/command.hh b/src/libcmd/command.hh index 078e2a2ce..65626e33f 100644 --- a/src/libcmd/command.hh +++ b/src/libcmd/command.hh @@ -132,6 +132,7 @@ struct InstallableCommand : virtual Args, SourceExprCommand InstallableCommand(bool supportReadOnlyMode = false); void prepare() override; + std::shared_ptr<Installable> load(); std::optional<FlakeRef> getFlakeRefForCompletion() override { diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index 635ce19b6..7d2ff0f68 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -1054,10 +1054,13 @@ InstallableCommand::InstallableCommand(bool supportReadOnlyMode) }} }); } +std::shared_ptr<Installable> InstallableCommand::load() { + return parseInstallable(getStore(), _installable); +} void InstallableCommand::prepare() { - installable = parseInstallable(getStore(), _installable); + installable = load(); } } |