mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
appmgr: feature flag for avahi
This commit is contained in:
committed by
Aiden McClelland
parent
218bae3b46
commit
1c8889a60c
@@ -13,13 +13,14 @@ name = "appmgr"
|
||||
path = "src/main.rs"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
avahi = ["avahi-sys"]
|
||||
default = ["avahi"]
|
||||
portable = []
|
||||
production = []
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1.42"
|
||||
avahi-sys = { git = "https://github.com/Start9Labs/avahi-sys", branch = "feature/dynamic-linking", features = ["dynamic"] }
|
||||
avahi-sys = { git = "https://github.com/Start9Labs/avahi-sys", branch = "feature/dynamic-linking", features = ["dynamic"], optional = true }
|
||||
base32 = "0.4.0"
|
||||
clap = "2.33"
|
||||
ctrlc = "3.1.7"
|
||||
|
||||
@@ -31,6 +31,7 @@ pub mod error;
|
||||
pub mod index;
|
||||
pub mod inspect;
|
||||
pub mod install;
|
||||
#[cfg(feature = "avahi")]
|
||||
pub mod lan;
|
||||
pub mod logs;
|
||||
pub mod manifest;
|
||||
|
||||
@@ -162,6 +162,21 @@ async fn inner_main() -> Result<(), Error> {
|
||||
),
|
||||
);
|
||||
|
||||
#[cfg(feature = "avahi")]
|
||||
let app = app.subcommand(
|
||||
SubCommand::with_name("lan")
|
||||
.about("Configures LAN services")
|
||||
.subcommand(
|
||||
SubCommand::with_name("enable")
|
||||
.about("Publishes the LAN address for the service over avahi")
|
||||
.arg(
|
||||
Arg::with_name("ID")
|
||||
.help("ID of the application to publish the LAN address for")
|
||||
.required(true),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
#[cfg(not(feature = "portable"))]
|
||||
let mut app = app
|
||||
.subcommand(
|
||||
@@ -448,19 +463,6 @@ async fn inner_main() -> Result<(), Error> {
|
||||
)
|
||||
.subcommand(SubCommand::with_name("reload").about("Reloads the tor configuration")),
|
||||
)
|
||||
.subcommand(
|
||||
SubCommand::with_name("lan")
|
||||
.about("Configures LAN services")
|
||||
.subcommand(
|
||||
SubCommand::with_name("enable")
|
||||
.about("Publishes the LAN address for the service over avahi")
|
||||
.arg(
|
||||
Arg::with_name("ID")
|
||||
.help("ID of the application to publish the LAN address for")
|
||||
.required(true),
|
||||
),
|
||||
),
|
||||
)
|
||||
.subcommand(
|
||||
SubCommand::with_name("info")
|
||||
.about("Prints information about an installed app")
|
||||
@@ -1200,6 +1202,7 @@ async fn inner_main() -> Result<(), Error> {
|
||||
std::process::exit(1);
|
||||
}
|
||||
},
|
||||
#[cfg(feature = "avahi")]
|
||||
#[cfg(not(feature = "portable"))]
|
||||
("lan", Some(sub_m)) => match sub_m.subcommand() {
|
||||
("enable", Some(sub_sub_m)) => {
|
||||
|
||||
Reference in New Issue
Block a user