Skip to content

Commit 1908263

Browse files
committed
FTS-1816: Add deprecaton notice to the C++ clients
1 parent e9772da commit 1908263

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

src/cli/MsgPrinter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ void MsgPrinter::print_info(std::string const & ostr_subject, std::string const
6464
jout.print(json_subject, boost::lexical_cast<std::string>(h) + ":" + boost::lexical_cast<std::string>(m));
6565
}
6666

67+
void MsgPrinter::print_info(std::string const & msg)
68+
{
69+
print(msg);
70+
}
71+
6772
void MsgPrinter::print_info(std::string const & ostr_subject, std::string const & json_subject, std::string const & msg)
6873
{
6974
if (!verbose) return;

src/cli/MsgPrinter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class MsgPrinter
6161
}
6262

6363
void print_info(std::string const & ostr_subject, std::string const & json_subject, long int h, long int m);
64+
void print_info(std::string const & msg);
6465
void print_info(std::string const & ostr_subject, std::string const & json_subject, std::string const & msg);
6566
void print_info(std::string const & json_subject, std::string const & msg);
6667
void print_info(std::string const & ostr_subject, std::string const & json_subject, bool flag);

src/cli/ui/CliBase.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ CliBase::CliBase() : visible("Allowed options")
5555

5656
version = getCliVersion();
5757
interface = version;
58+
printDeprecationNote();
5859
}
5960

6061
void CliBase::parse(int ac, char *av[])
@@ -122,6 +123,12 @@ void CliBase::validate()
122123
}
123124
}
124125

126+
void CliBase::printDeprecationNote() const
127+
{
128+
MsgPrinter::instance().print_info("NOTICE: This command is deprecated! Please use fts-rest-* commands provided"
129+
" by the \"fts-rest-client\" package.");
130+
}
131+
125132
void CliBase::printCliDetails() const
126133
{
127134
MsgPrinter::instance().print_info("# Client version", "client_version", version);

src/cli/ui/CliBase.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ class CliBase {
153153

154154
protected:
155155

156+
/**
157+
* Print deprecation note on every command line tool
158+
*/
159+
void printDeprecationNote() const;
160+
156161
/**
157162
* If verbose additional info is printed
158163
*/

0 commit comments

Comments
 (0)