From 7213030ad7b829f19c67ac337f93ee28e37c1dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= <cedric.traizet@c-s.fr> Date: Fri, 3 May 2019 17:24:02 +0200 Subject: [PATCH] ENH: display deprecation status in cli (execution and help) --- .../CommandLine/src/otbWrapperCommandLineLauncher.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx index b5ef08d6ac..bc7ea48ced 100644 --- a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx +++ b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx @@ -282,6 +282,11 @@ bool CommandLineLauncher::BeforeExecute() return false; } + if (m_Application->IsDeprecated()) + { + m_Application->GetLogger()->Warning("This application is deprecated and will be removed in a future OTB release.\n"); + } + return true; } @@ -584,6 +589,12 @@ void CommandLineLauncher::DisplayHelp(bool longHelp) std::cerr<<std::endl; std::cerr << "This is the "<<m_Application->GetDocName() << " ("<<m_Application->GetName()<<") application, version " << OTB_VERSION_STRING <<std::endl<<std::endl; + if (m_Application->IsDeprecated()) + { + std::cerr << "WARNING: This application is deprecated, it will be removed in a future OTB release." << std::endl; + std::cerr << std::endl; + } + std::cerr << m_Application->GetDescription() << std::endl; if(longHelp) -- GitLab