summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2020-07-10 12:39:43 +0200
committerLinus Färnstrand <linus@mullvad.net>2020-07-10 14:59:49 +0200
commite0a3c729368e119e539fbf111cffc1e784f8a1d5 (patch)
tree2529c457b6ab17b10b0e809cf0517c704c1ddfc7
parent7794d5e2477c259ba29daf7fda23f4384336c4c7 (diff)
downloadmullvadvpn-e0a3c729368e119e539fbf111cffc1e784f8a1d5.tar.xz
mullvadvpn-e0a3c729368e119e539fbf111cffc1e784f8a1d5.zip
Ignore deprecation warning in clap macro invocation
-rw-r--r--mullvad-daemon/src/cli.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/mullvad-daemon/src/cli.rs b/mullvad-daemon/src/cli.rs
index d39a80309e..870b15a624 100644
--- a/mullvad-daemon/src/cli.rs
+++ b/mullvad-daemon/src/cli.rs
@@ -64,9 +64,8 @@ lazy_static::lazy_static! {
}
fn create_app() -> App<'static, 'static> {
- let app = App::new(crate_name!())
+ let mut app = App::new(crate_name!())
.version(version::PRODUCT_VERSION)
- .author(crate_authors!(", "))
.about(crate_description!())
.after_help(ENV_DESC.as_str())
.arg(
@@ -84,10 +83,15 @@ fn create_app() -> App<'static, 'static> {
Arg::with_name("disable_stdout_timestamps")
.long("disable-stdout-timestamps")
.help("Don't log timestamps when logging to stdout, useful when running as a systemd service")
- );
+ );
+ // A workaround since clap 2 will not fix the deprecation warnings in this macro.
+ #[allow(deprecated)]
+ {
+ app = app.author(crate_authors!(", "));
+ }
if cfg!(windows) {
- app.arg(
+ app = app.arg(
Arg::with_name("run_as_service")
.long("run-as-service")
.help("Run as a system service. On Windows this option must be used when running a system service"),
@@ -96,7 +100,6 @@ fn create_app() -> App<'static, 'static> {
.long("register-service")
.help("Register itself as a system service"),
)
- } else {
- app
}
+ app
}