18 #ifndef _BASIS_CMDLINE_H 19 #define _BASIS_CMDLINE_H 22 #include "tclap/CmdLine.h" 75 int n = TCLAP::XorHandler::check(a);
76 return a->isRequired() ? n : 0;
100 CmdLine(
const std::string& name,
101 const std::string& project,
102 const std::string& description,
103 const std::string& example,
104 const std::string& version,
105 const std::string& copyright =
106 "Copyright (c) University of Pennsylvania." 107 " All rights reserved.",
108 const std::string& license =
109 "See http://www.rad.upenn.edu/sbia/software/license.html" 111 const std::string& contact =
112 "SBIA Group <sbia-software at uphs.upenn.edu>",
113 bool stdargs =
true);
130 CmdLine(
const std::string& name,
131 const std::string& project,
132 const std::string& description,
133 const std::vector<std::string>& examples,
134 const std::string& version,
135 const std::string& copyright =
136 "Copyright (c) University of Pennsylvania." 137 " All rights reserved.",
138 const std::string& license =
139 "See http://www.rad.upenn.edu/sbia/software/license.html" 141 const std::string& contact =
142 "SBIA Group <sbia-software at uphs.upenn.edu>",
143 bool stdargs =
true);
185 void xorAdd(std::vector<Arg*>& xors);
216 void parse(
int argc,
const char*
const* argv);
224 void parse(std::vector<std::string>& args);
291 void setup(
bool stdargs);
318 #endif // _BASIS_CMDLINE_H void xorAdd(Arg &a, Arg &b)
Add two Args that will be xor'd.
std::vector< std::string > & getExamples()
Get usage example.
void setup(bool stdargs)
Set up command-line object.
XorHandler _xorHandler
Customized XorHandler.
std::string & getProjectName()
Get name of project the program belongs to.
void parse(int argc, const char *const *argv)
Parses the command line.
void print_usage() const
Print short help, i.e., usage information.
std::string _name
Program name.
std::string _project
Name of project.
Definition of commonly used command-line arguments.
std::string _copyright
Program copyright.
CmdLine(const std::string &name, const std::string &project, const std::string &description, const std::string &example, const std::string &version, const std::string ©right="Copyright (c) University of Pennsylvania." " All rights reserved.", const std::string &license="See http://www.rad.upenn.edu/sbia/software/license.html" " or COPYING file.", const std::string &contact="SBIA Group <sbia-software at uphs.upenn.edu>", bool stdargs=true)
Constructor.
std::string & getDescription()
Get program description.
int check(const Arg *a)
Checks whether the specified Arg is in one of the xor lists.
TCLAP::Arg Arg
Base type of command-line arguments.
Manages command line definition and parsing of arguments.
std::string _contact
Contact information.
std::string _license
Program license.
XorHandler & getXorHandler()
Get handler of XOR'd arguments.
Handles lists of Arg's that are to be XOR'd on the command-line.
void add(Arg &a)
Adds an argument to the list of arguments to be parsed.
std::string & getContact()
Get contact information.
void print_help() const
Print help.
std::vector< std::string > _examples
Program usage example.
std::string & getProgramName()
Get name of program.
std::string & getCopyright()
Get copyright notice.
std::string & getLicense()
Get license information.
void print_version() const
Print version information.
virtual ~CmdLine()
Destructor.