seapodym-parallel
Fish dynamics models with parameter estimations
Loading...
Searching...
No Matches
CmdLineArgParser Class Reference

Parse command line arguments. More...

#include <CmdLineArgParser.h>

Public Member Functions

 CmdLineArgParser ()
 
void set (const std::string &name, double defaultVal, const std::string &help)
 Parse command line arguments.
 
void set (const std::string &name, int defaultVal, const std::string &help)
 
void set (const std::string &name, const std::string &defaultVal, const std::string &help)
 
void set (const std::string &name, bool defaultVal, const std::string &help)
 
bool parse (int argc, char *argv[])
 
void setPurpose (const std::string &purpose)
 
void print () const
 
void help () const
 
void addFootnote (const std::string &note)
 
template<class T>
get (const std::string &name) const
 
template<>
double get (const std::string &name) const
 
template<>
int get (const std::string &name) const
 
template<>
std::string get (const std::string &name) const
 
template<>
bool get (const std::string &name) const
 

Detailed Description

Parse command line arguments.

Author
Alexander Pletzer

This software is provided with the hope that it will be useful. It comes with no warranty whatsoever. Please send bug reports to alexa.nosp@m.nder.nosp@m.@gokl.nosp@m.iya..nosp@m.net.

Simple command line argument parser

Constructor & Destructor Documentation

◆ CmdLineArgParser()

CmdLineArgParser::CmdLineArgParser ( )
inline

Constructor

Member Function Documentation

◆ addFootnote()

void CmdLineArgParser::addFootnote ( const std::string & note)
inline

Add, optional text to the help message

Parameters
notetext to add

◆ get()

template<class T>
T CmdLineArgParser::get ( const std::string & name) const

Get parameter value by name

Parameters
name
Returns
value

◆ help()

void CmdLineArgParser::help ( ) const

Print help to stdout

◆ parse()

bool CmdLineArgParser::parse ( int argc,
char * argv[] )

Parse command line arguments

Parameters
argcnumber of arguments
argvarguments
Returns
true if all arguments were successfully parsed, false otherwise

◆ print()

void CmdLineArgParser::print ( ) const

Print the arguments

◆ set()

void CmdLineArgParser::set ( const std::string & name,
double defaultVal,
const std::string & help )

Parse command line arguments.

Set command line argument

Parameters
name
defaultValdefault value
helphelp string
Author
Alexander Pletzer

This software is provided with the hope that it will be useful. It comes with no warranty whatsoever. Please send bug reports to alexa.nosp@m.nder.nosp@m.@gokl.nosp@m.iya..nosp@m.net.

◆ setPurpose()

void CmdLineArgParser::setPurpose ( const std::string & purpose)
inline

Set purpose of executable

Parameters
purposebrief one-liner

The documentation for this class was generated from the following files: