MCPcopy Create free account
hub / github.com/daniele77/cli / Exec

Method Exec

include/cli/cli.h:777–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775 }
776
777 bool Exec(const std::vector< std::string >& cmdLine, CliSession& session) override
778 {
779 if (!IsEnabled()) return false;
780 const std::size_t paramSize = sizeof...(Args);
781 if (cmdLine.size() != paramSize+1) return false;
782 if (Name() == cmdLine[0])
783 {
784 try
785 {
786 auto g = [&](auto ... pars){ func( session.OutStream(), pars... ); };
787 Select<Args...>::Exec(g, std::next(cmdLine.begin()), cmdLine.end());
788 }
789 catch (std::bad_cast&)
790 {
791 return false;
792 }
793 return true;
794 }
795 return false;
796 }
797
798 void Help(std::ostream& out) const override
799 {

Callers

nothing calls this directly

Calls 1

OutStreamMethod · 0.80

Tested by

no test coverage detected