54 char *envval = getenv(envvar.c_str());
64 paths.push_back(pathstring.substr(lastPos, pos - lastPos));
65 lastPos = pathstring.find_first_not_of(
":", pos);
66 pos = pathstring.find_first_of(
":", lastPos);
117 struct option longopts[] = {
119 #ifdef ENABLE_DOCSERVER 133 #ifdef ENABLE_DOCSERVER 143 "Usage: arts [-bBdghimnrsSvw]\n" 144 " [--basename <name>]\n" 145 " [--describe <method or variable>]\n" 148 " [--includepath <path>]\n" 149 " [--datapath <path>]\n" 150 " [--input <variable>]\n" 151 " [--methods all|<variable>]\n" 152 " [--numthreads <#>\n" 153 " [--outdir <name>]\n" 155 " [--reporting <xyz>]\n" 156 #ifdef ENABLE_DOCSERVER 157 " [--docserver[=<port>] --baseurl=BASEURL]\n" 158 " [--docdaemon[=<port>] --baseurl=BASEURL]\n" 160 " [--workspacevariables all|<method>]\n" 161 " file1.arts file2.arts ...";
164 "The Atmospheric Radiative Transfer Simulator.\n\n" 165 "-b, --basename Set the basename for the report\n" 166 " file and for other output files.\n" 167 "-d, --describe Print the description String of the given\n" 168 " workspace variable or method.\n" 169 "-g --groups List all workspace variable groups.\n" 170 "-h, --help Print this message.\n" 171 "-i, --input This is complementary to the --methods switch.\n" 172 " It must be given the name of a variable (or group).\n" 173 " Then it lists all methods that take this variable\n" 174 " (or group) as input.\n" 175 "-I --includepath Search path for include files. Can be given more\n" 176 " than once to add several paths.\n" 177 " Include paths can also be added by setting the\n" 178 " environment variable ARTS_INCLUDE_PATH. Multiple\n" 179 " paths have to be separated by colons.\n" 180 " Paths specified on the commandline have precedence\n" 181 " over the environment variable and will be searched\n" 183 "-D --datapath Additional search path for data files. Directories\n" 184 " specified here will be searched after the includepath.\n" 185 " Data paths can also be added by setting the\n" 186 " environment variable ARTS_DATA_PATH.\n" 187 "-m, --methods If this is given the argument 'all',\n" 188 " it simply prints a list of all methods.\n" 189 " If it is given the name of a variable\n" 190 " (or variable group), it prints all\n" 191 " methods that produce this\n" 192 " variable (or group) as output.\n" 193 "-n, --numthreads If arts was compiled with OpenMP support this option\n" 194 " can be used to set the maximum number of threads.\n" 195 " By default OpenMP uses all processors/cores.\n" 196 "-o, --outdir Set the output directory for the report\n" 197 " file and for other output files with relative paths.\n" 198 " Default is the current directory.\n" 199 "-p --plain Generate plain help output suitable for\n" 200 " script processing.\n" 201 "-r, --reporting Three digit integer. Sets the reporting\n" 202 " level for agenda calls (first digit),\n" 203 " screen (second digit) and file (third \n" 204 " digit). All reporting levels can reach from 0\n" 205 " (only error messages) to 3 (everything).\n" 206 " The agenda setting applies in addition to both\n" 207 " screen and file output.\n" 209 #ifdef ENABLE_DOCSERVER 210 "-s, --docserver Start documentation server. Optionally, specify\n" 211 " the port number the server should listen on,\n" 212 " e.g. arts -s9999 or arts --docserver=9999.\n" 213 " Default is 9000.\n" 214 "-S, --docdaemon Start documentation server in the background.\n" 215 "-U, --baseurl Base URL for the documentation server.\n" 217 "-v, --version Show version information.\n" 218 "-w, --workspacevariables If this is given the argument 'all',\n" 219 " it simply prints a list of all variables.\n" 220 " If it is given the name of a method, it\n" 221 " prints all variables needed by this method.\n" 222 #ifdef ENABLE_DOCSERVER 223 "\nDEVELOPER ONLY:\n\n" 224 "-C, --check-docs Check for broken links in built-in docs.\n" 240 while (NULL != longopts[i].
name) {
241 char c = (char)longopts[i].
val;
265 argc, argv, shortopts.c_str(), longopts, (
int *)0))) {
269 parameters.
help =
true;
284 parameters.
gui =
true;
301 if (iss.bad() || !iss.eof()) {
302 cerr <<
"Argument to --numthreads (-n) must be an integer!\n";
311 parameters.
plain =
true;
322 if (iss.bad() || !iss.eof()) {
323 cerr <<
"Argument to --reporting (-r) must be an integer!\n";
332 if (iss.bad() || !iss.eof()) {
333 cerr <<
"Argument to --docserver (-s) must be an integer!\n";
344 if (iss.bad() || !iss.eof()) {
345 cerr <<
"Argument to --docdaemon (-S) must be an integer!\n";
385 #ifdef ARTS_DEFAULT_INCLUDE_DIR 390 arts_default_include_path.find_first_not_of(
":", 0);
393 arts_default_include_path.find_first_of(
":", lastPos);
397 arts_default_include_path.substr(lastPos, pos - lastPos));
398 lastPos = arts_default_include_path.find_first_not_of(
":", pos);
399 pos = arts_default_include_path.find_first_of(
":", lastPos);
bool daemon
Flag to run the docserver in the background.
ArrayOfString controlfiles
The filenames of the controlfiles.
Parameters parameters
Holds the command line parameters.
Index nelem() const
Number of elements.
void arts_exit(int status)
This is the exit function of ARTS.
String baseurl
Baseurl for the docserver.
bool check_docs
Flag to check built-in documentation.
String basename
If this is specified (with the -b –basename option), it is used as the base name for the report file...
bool groups
Print a list of all workspace variable groups.
void get_dirname(String &dirname, const String &path)
Return the parent directory of a path.
This file contains basic functions to handle ASCII files.
Structure to hold all command line Parameters.
String methods
If this is given the argument `all', it simply prints a list of all methods.
void parse_path_from_environment(String envvar, ArrayOfString &paths)
Parse path environment variable.
String input
This is complementary to the methods switch.
ArrayOfString includepath
List of paths to search for include files.
ArrayOfString datapath
List of paths to search for data files.
String outdir
If this is specified (with the -o –outdir option), it is used as the base directory for the report f...
Index numthreads
The maximum number of threads to use.
The global header file for ARTS.
bool help
Only display the help text.
Index reporting
This should be a two digit integer.
Index docserver
Port to use for the docserver.
Index nelem() const
Number of elements.
String usage
Short message how to call the program.
bool gui
Flag to run with graphical user interface.
This can be used to make arrays out of anything.
#define optional_argument
#define ARTS_DEFAULT_INCLUDE_DIR
bool get_parameters(int argc, char **argv)
Get the command line parameters.
String workspacevariables
If this is given the argument `all', it simply prints a list of all workspace variables.
bool version
Display version information.
static const Index npos
Define npos:
This file contains header information for the dealing with command line parameters.
bool plain
Generate plain help out suitable for script processing.
#define required_argument
my_basic_string< char > String
The String type for ARTS.
String describe
Print the description String of the given workspace variable or method.
String helptext
Longer message explaining the options.