Skip to content

Commit 39b3881

Browse files
committed
check for cli feature before using clap
1 parent 17d04ae commit 39b3881

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/planner/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,16 @@ dyn_clone::clone_trait_object!(Planner);
158158
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
159159
#[cfg_attr(feature = "cli", derive(clap::Subcommand))]
160160
pub enum BuiltinPlanner {
161-
#[cfg_attr(not(target_os = "linux"), clap(hide = true))]
161+
#[cfg_attr(all(feature = "cli", not(target_os = "linux")), clap(hide = true))]
162162
/// A planner for traditional, mutable Linux systems like Debian, RHEL, or Arch
163163
Linux(linux::Linux),
164-
#[cfg_attr(not(target_os = "linux"), clap(hide = true))]
164+
#[cfg_attr(all(feature = "cli", not(target_os = "linux")), clap(hide = true))]
165165
/// A planner for the Valve Steam Deck running SteamOS
166166
SteamDeck(steam_deck::SteamDeck),
167-
#[cfg_attr(not(target_os = "linux"), clap(hide = true))]
167+
#[cfg_attr(all(feature = "cli", not(target_os = "linux")), clap(hide = true))]
168168
/// A planner suitable for immutable systems using ostree, such as Fedora Silverblue
169169
Ostree(ostree::Ostree),
170-
#[cfg_attr(not(target_os = "macos"), clap(hide = true))]
170+
#[cfg_attr(all(feature = "cli", not(target_os = "macos")), clap(hide = true))]
171171
/// A planner for MacOS (Darwin) systems
172172
Macos(macos::Macos),
173173
}

src/settings.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ pub struct CommonSettings {
140140
)]
141141
pub nix_package_url: Option<UrlOrPath>,
142142

143-
#[clap(from_global)]
143+
#[cfg_attr(all(feature = "cli"), clap(from_global))]
144144
pub proxy: Option<Url>,
145-
#[clap(from_global)]
145+
#[cfg_attr(all(feature = "cli"), clap(from_global))]
146146
pub ssl_cert_file: Option<PathBuf>,
147147

148148
/// Extra configuration lines for `/etc/nix.conf`

0 commit comments

Comments
 (0)