From 2db549d9769025a8ae634b55031ea4cda0224f70 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 28 Oct 2014 12:08:31 +0100 Subject: [PATCH] Cli: Don't suggest '--import' on 'repository remove' refs #7255 --- lib/cli/repositoryobjectcommand.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cli/repositoryobjectcommand.cpp b/lib/cli/repositoryobjectcommand.cpp index 6924dccdf..444d9e9fa 100644 --- a/lib/cli/repositoryobjectcommand.cpp +++ b/lib/cli/repositoryobjectcommand.cpp @@ -119,8 +119,10 @@ String RepositoryObjectCommand::GetShortDescription(void) const void RepositoryObjectCommand::InitParameters(boost::program_options::options_description& visibleDesc, boost::program_options::options_description& hiddenDesc) const { - visibleDesc.add_options() - ("import", po::value >(), "Import the defined template(s) into the object. Must be defined and included separately in Icinga 2"); + if (m_Command == RepositoryCommandAdd) { + visibleDesc.add_options() + ("import", po::value >(), "Import the defined template(s) into the object. Must be defined and included separately in Icinga 2"); + } } std::vector RepositoryObjectCommand::GetPositionalSuggestions(const String& word) const