Go to the documentation of this file.
53 virtual void printHelp(std::ostream& out,
bool pretty =
true)
55 out <<
"Welcome to the help for x" << std::endl;
67 virtual void printHelp(std::ostream& out,
bool pretty =
true)
69 out <<
"Welcome to the help for y." << std::endl
70 <<
"Values:" << std::endl;
71 for (
unsigned i = 0; i <
value.size(); i++)
72 out <<
" " <<
value[i] << std::endl;
81 bool initialize(
int argc,
char *argv[],
bool pretty =
true) noexcept;
95 : BasicFramework(applName,
"Facilitate testing of help-like options"),
96 sOpt(
'w',
"whelp",
"It was just a coincidence, I swear.",
97 "Odd groups got left, even groups got right. That means 1, 3, 5,\n"
98 " 7 left; 2, 4, 6, 8 right. 7 & 8 are whelp groups.\n"),
102 std::string::size_type p = std::string::npos;
104 p = execName.find_last_of(
"/\\");
105 if (p != std::string::npos)
107 execName.erase(0, p+1);
110 p = execName.find_last_of(
'.');
111 if (p != std::string::npos)
124 if (execName ==
"BasicFrameworkHelp_T")
128 else if (execName ==
"BasicFrameworkHelpReq_T")
137 std::cerr <<
"Executable name \"" << execName <<
"\" is not known"
144 int main(
int argc,
char *argv[])
158 std::cerr << exc << std::endl;
160 catch (std::exception &exc)
162 std::cerr <<
"Caught std::exception " << exc.
what() << std::endl;
166 std::cerr <<
"Caught unknown exception";
169 std::cerr <<
": " << std::strerror(errno);
171 std::cerr << std::endl;
virtual ~CommandOptionHelpTest()
std::string what() const
Dump to a string.
static const int EXCEPTION_ERROR
CommandOptionHelp(const CommandOption::CommandOptionFlag of, const char shOpt, const std::string &loOpt, const std::string &desc)
Specialized help-like option that takes an argument.
CommandOptionHelpTestArg yOpt
int initialize(string &errors)
virtual ~BasicFrameworkHelp_T()
CommandOptionHelpTestArg()
virtual void printHelp(std::ostream &out, bool pretty=true)
std::vector< std::string > value
Any arguments passed with this option get put in here.
gnsstk::CommandOptionNoArg * reqOpt
bool initialize(int argc, char *argv[], bool pretty=true) noexcept
CommandOptionHelpTest xOpt
BasicFrameworkHelp_T(const std::string &applName) noexcept
@ hasArgument
option requires an argument
@ noArgument
option requires no arguments
int main(int argc, char *argv[])
gnsstk::CommandOptionHelpSimple sOpt
virtual ~CommandOptionHelpTestArg()
virtual void printHelp(std::ostream &out, bool pretty=true)
Specialized help-like command-line option.
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:38