mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-06-06 02:54:23 +02:00
Upgrade to 0.8.11. While at it, also reduce the size of the patch and split it up into separate patches. This hopefully makes maintaining the patches are easier. The patches make it so that libz isn't statically linked, the "cli-docs" feature for manual pages with the CLI is disabled, and the exposed subcommands for the "cli-docs" feature are hidden because they're not available anyway. The code for D-Bus notifications and for displaying the manual pages isn't removed like before because this code is conditionally compiled in only when the features "dbus-notifications" and "cli-docs" are enabled. This shrinks the size of the patch significantly and shouldn't affect the size of the binary. Signed-off-by: Thomas Böhler <witcher@wiredspace.de>
80 lines
3 KiB
Diff
80 lines
3 KiB
Diff
From 9565751b1063913dfd578e4b64e19cf8a468491c Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Thomas=20B=C3=B6hler?= <witcher@wiredspace.de>
|
|
Date: Sat, 26 Apr 2025 14:46:10 +0200
|
|
Subject: [PATCH 3/3] hide man-related subcommands if disabled
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Signed-off-by: Thomas Böhler <witcher@wiredspace.de>
|
|
---
|
|
meli/src/args.rs | 8 ++++++++
|
|
meli/tests/test_cli_subcommands.rs | 22 +++++++++++++---------
|
|
2 files changed, 21 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/meli/src/args.rs b/meli/src/args.rs
|
|
index a97c7497..cd43f016 100644
|
|
--- a/meli/src/args.rs
|
|
+++ b/meli/src/args.rs
|
|
@@ -91,9 +91,17 @@ pub enum SubCommand {
|
|
Tools(ToolOpt),
|
|
#[structopt(visible_alias="docs", aliases=&["docs", "manpage", "manpages"])]
|
|
#[structopt(display_order = 4)]
|
|
+ #[cfg_attr(
|
|
+ not(feature = "cli-docs"),
|
|
+ structopt(setting(structopt::clap::AppSettings::Hidden))
|
|
+ )]
|
|
/// print documentation page and exit (Piping to a pager is recommended.).
|
|
Man(ManOpt),
|
|
#[structopt(display_order = 5)]
|
|
+ #[cfg_attr(
|
|
+ not(feature = "cli-docs"),
|
|
+ structopt(setting(structopt::clap::AppSettings::Hidden))
|
|
+ )]
|
|
/// Install manual pages to the first location provided by `$MANPATH` /
|
|
/// `manpath(1)`, unless you specify the directory as an argument.
|
|
InstallMan {
|
|
diff --git a/meli/tests/test_cli_subcommands.rs b/meli/tests/test_cli_subcommands.rs
|
|
index 053d93e8..e16aae59 100644
|
|
--- a/meli/tests/test_cli_subcommands.rs
|
|
+++ b/meli/tests/test_cli_subcommands.rs
|
|
@@ -76,14 +76,20 @@ fn help(env: &Env) {
|
|
// --help is successful
|
|
for arg in ["--help", "-h"] {
|
|
let mut cmd = Command::cargo_bin("meli").unwrap();
|
|
- let output = cmd
|
|
- .env_clear()
|
|
- .envs(env)
|
|
- .arg(arg)
|
|
- .output()
|
|
- .unwrap()
|
|
- .assert();
|
|
+ let output = cmd.env_clear().envs(env).arg(arg).output().unwrap();
|
|
+
|
|
+ #[cfg(feature = "cli-docs")]
|
|
+ {
|
|
+ let output = output.clone();
|
|
+ output
|
|
+ .assert()
|
|
+ .code(0)
|
|
+ .stdout(predicates::str::contains("man"))
|
|
+ .stdout(predicates::str::contains("install-man"));
|
|
+ }
|
|
+
|
|
output
|
|
+ .assert()
|
|
.code(0)
|
|
.stdout(predicates::str::contains("terminal mail client"))
|
|
.stdout(predicates::str::contains("USAGE"))
|
|
@@ -93,8 +99,6 @@ fn help(env: &Env) {
|
|
.stdout(predicates::str::contains("create-config"))
|
|
.stdout(predicates::str::contains("test-config"))
|
|
.stdout(predicates::str::contains("tools"))
|
|
- .stdout(predicates::str::contains("man"))
|
|
- .stdout(predicates::str::contains("install-man"))
|
|
.stdout(predicates::str::contains("compiled-with"))
|
|
.stdout(predicates::str::contains("edit-config"))
|
|
.stdout(predicates::str::contains("help"))
|
|
--
|
|
2.49.0
|
|
|