diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2022-05-13 07:57:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-13 06:57:27 +0100 |
commit | 14b30606a5b2e127f5490f184c8af9ffab780095 (patch) | |
tree | 181cfc9e152b52defde17590db77817d48300a98 | |
parent | 5e4e8d11528fde2f773dbb4445c216fadd09cb86 (diff) |
Allow to build atuin server without client (#404)
-rw-r--r-- | Cargo.toml | 5 | ||||
-rw-r--r-- | src/command/mod.rs | 3 |
2 files changed, 6 insertions, 2 deletions
@@ -33,13 +33,14 @@ members = ["./atuin-client", "./atuin-server", "./atuin-common"] # TODO(conradludgate) # Currently, this keeps the same default built behaviour for v0.8 # We should rethink this by the time we hit a new breaking change -default = ["sync", "server"] +default = ["client", "sync", "server"] +client = ["atuin-client"] sync = ["atuin-client/sync"] server = ["atuin-server", "tracing-subscriber"] [dependencies] atuin-server = { path = "atuin-server", version = "0.9.1", optional = true } -atuin-client = { path = "atuin-client", version = "0.9.1", default-features = false } +atuin-client = { path = "atuin-client", version = "0.9.1", optional = true, default-features = false } atuin-common = { path = "atuin-common", version = "0.9.1" } log = "0.4" diff --git a/src/command/mod.rs b/src/command/mod.rs index c86e76f5..ca7fc724 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -1,6 +1,7 @@ use clap::Subcommand; use eyre::Result; +#[cfg(feature = "client")] mod client; #[cfg(feature = "server")] @@ -9,6 +10,7 @@ mod server; #[derive(Subcommand)] #[clap(infer_subcommands = true)] pub enum AtuinCmd { + #[cfg(feature = "client")] #[clap(flatten)] Client(client::Cmd), @@ -21,6 +23,7 @@ pub enum AtuinCmd { impl AtuinCmd { pub fn run(self) -> Result<()> { match self { + #[cfg(feature = "client")] Self::Client(client) => client.run(), #[cfg(feature = "server")] Self::Server(server) => server.run(), |