add warning when binary is called with 'inn' shortcut

pull/178/head
Jake McGinty 2021-11-30 04:16:44 +09:00
parent 11a66b635e
commit d2a2e881e5
1 changed files with 10 additions and 0 deletions

View File

@ -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);