From d2a2e881e57e45f937eed95f52ece3008e2cf79f Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Tue, 30 Nov 2021 04:16:44 +0900 Subject: [PATCH] add warning when binary is called with 'inn' shortcut --- client/src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/src/main.rs b/client/src/main.rs index 535d6ed..5a86b52 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -1124,6 +1124,16 @@ fn main() { let opts = Opts::from_args(); util::init_logger(opts.verbose); + let argv0 = std::env::args().next().unwrap(); + let executable = Path::new(&argv0).file_name().unwrap().to_str().unwrap(); + if executable == "inn" { + log::warn!(""); + log::warn!(" {}: the {} shortcut will be removed from OS packages soon in favor of users creating a shell alias.", "WARNING".bold(), "inn".yellow()); + log::warn!(""); + log::warn!(" See https://github.com/tonarino/innernet/issues/176 for instructions to continue using it."); + log::warn!(""); + } + if let Err(e) = run(&opts) { println!(); log::error!("{}\n", e);