aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/command.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-04 20:45:40 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-20 10:39:18 -0500
commit0258ac9c2a49eb0cc632bc02d72093392bd37bfc (patch)
tree32fd9fecc91bd51ab81046bb5cc1fa98be3f997b /src/libcmd/command.hh
parent924ef6761bbbc75fda3cf85dc1c8d782130291b4 (diff)
Make `--read-only` a separate mixin
It is independent of SourceExprCommand, which is about parsing installables, except for the fact that parsing installables is one of the many things influenced by read-only mode.
Diffstat (limited to 'src/libcmd/command.hh')
-rw-r--r--src/libcmd/command.hh10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libcmd/command.hh b/src/libcmd/command.hh
index 1516daa00..b6d554aab 100644
--- a/src/libcmd/command.hh
+++ b/src/libcmd/command.hh
@@ -94,9 +94,8 @@ struct SourceExprCommand : virtual Args, MixFlakeOptions
{
std::optional<Path> file;
std::optional<std::string> expr;
- bool readOnlyMode = false;
- SourceExprCommand(bool supportReadOnlyMode = false);
+ SourceExprCommand();
std::vector<std::shared_ptr<Installable>> parseInstallables(
ref<Store> store, std::vector<std::string> ss);
@@ -111,6 +110,11 @@ struct SourceExprCommand : virtual Args, MixFlakeOptions
void completeInstallable(std::string_view prefix);
};
+struct MixReadOnlyOption : virtual Args
+{
+ MixReadOnlyOption();
+};
+
/* A command that operates on a list of "installables", which can be
store paths, attribute paths, Nix expressions, etc. */
struct InstallablesCommand : virtual Args, SourceExprCommand
@@ -136,7 +140,7 @@ struct InstallableCommand : virtual Args, SourceExprCommand
{
std::shared_ptr<Installable> installable;
- InstallableCommand(bool supportReadOnlyMode = false);
+ InstallableCommand();
void prepare() override;