summaryrefslogtreecommitdiffstats
path: root/sq
diff options
context:
space:
mode:
Diffstat (limited to 'sq')
-rw-r--r--sq/build.rs5
-rw-r--r--sq/src/sq_cli.rs11
2 files changed, 12 insertions, 4 deletions
diff --git a/sq/build.rs b/sq/build.rs
index 3711838b..14818eee 100644
--- a/sq/build.rs
+++ b/sq/build.rs
@@ -13,7 +13,10 @@ fn main() {
// XXX: Revisit once
// https://github.com/rust-lang/rust/issues/44732 is stabilized.
- let mut sq = sq_cli::configure(clap::App::new("sq").set_term_width(80));
+ let mut sq = sq_cli::configure(
+ clap::App::new("sq").set_term_width(80),
+ cfg!(feature = "net"),
+ );
let mut main = fs::File::create("src/sq-usage.rs").unwrap();
dump_help(&mut main,
&mut sq,
diff --git a/sq/src/sq_cli.rs b/sq/src/sq_cli.rs
index 316beb10..7833a3bf 100644
--- a/sq/src/sq_cli.rs
+++ b/sq/src/sq_cli.rs
@@ -3,7 +3,9 @@
use clap::{App, Arg, ArgGroup, SubCommand, AppSettings};
pub fn build() -> App<'static, 'static> {
- configure(App::new("sq"))
+ configure(App::new("sq"),
+ cfg!(feature = "net"),
+ )
}
/// Defines the CLI.
@@ -16,7 +18,10 @@ pub fn build() -> App<'static, 'static> {
/// - Key discovery & networking (4xx)
/// - Armor (5xx)
/// - Inspection & packet manipulation (6xx)
-pub fn configure(app: App<'static, 'static>) -> App<'static, 'static> {
+pub fn configure(
+ app: App<'static, 'static>,
+ feature_net: bool,
+) -> App<'static, 'static> {
let version = Box::leak(
format!("{} (sequoia-openpgp {})",
env!("CARGO_PKG_VERSION"),
@@ -1227,7 +1232,7 @@ $ sq packet join juliet.pgp-[0-3]*
.short("B").long("binary")
.help("Emits binary data"))));
- let app = if ! cfg!(feature = "net") {
+ let app = if ! feature_net {
// Without networking support.
app
} else {