56 char *envval = getenv (envvar.c_str());
68 paths.push_back (pathstring.substr (lastPos, pos - lastPos));
69 lastPos = pathstring.find_first_not_of(
":", pos);
70 pos = pathstring.find_first_of(
":", lastPos);
123 struct option longopts[] =
140 #ifdef ENABLE_DOCSERVER 151 "Usage: arts [-bBdghimnrsSvw]\n" 152 " [--basename <name>]\n" 153 " [--describe <method or variable>]\n" 159 " [--includepath <path>]\n" 160 " [--datapath <path>]\n" 161 " [--input <variable>]\n" 162 " [--methods all|<variable>]\n" 163 " [--numthreads <#>\n" 164 " [--outdir <name>]\n" 166 " [--reporting <xyz>]\n" 167 #ifdef ENABLE_DOCSERVER 168 " [--docserver[=<port>] --baseurl=BASEURL]\n" 169 " [--docdaemon[=<port>] --baseurl=BASEURL]\n" 171 " [--workspacevariables all|<method>]\n" 172 " file1.arts file2.arts ...";
175 "The Atmospheric Radiative Transfer Simulator.\n\n" 176 "-b, --basename Set the basename for the report\n" 177 " file and for other output files.\n" 178 "-d, --describe Print the description String of the given\n" 179 " workspace variable or method.\n" 180 "-g --groups List all workspace variable groups.\n" 182 "-G --gui Start with graphical user interface.\n" 184 "-h, --help Print this message.\n" 185 "-i, --input This is complementary to the --methods switch.\n" 186 " It must be given the name of a variable (or group).\n" 187 " Then it lists all methods that take this variable\n" 188 " (or group) as input.\n" 189 "-I --includepath Search path for include files. Can be given more\n" 190 " than once to add several paths.\n" 191 " Include paths can also be added by setting the\n" 192 " environment variable ARTS_INCLUDE_PATH. Multiple\n" 193 " paths have to be separated by colons.\n" 194 " Paths specified on the commandline have precedence\n" 195 " over the environment variable and will be searched\n" 197 "-D --datapath Additional search path for data files. Directories\n" 198 " specified here will be searched after the includepath.\n" 199 " Data paths can also be added by setting the\n" 200 " environment variable ARTS_DATA_PATH.\n" 201 "-m, --methods If this is given the argument 'all',\n" 202 " it simply prints a list of all methods.\n" 203 " If it is given the name of a variable\n" 204 " (or variable group), it prints all\n" 205 " methods that produce this\n" 206 " variable (or group) as output.\n" 207 "-n, --numthreads If arts was compiled with OpenMP support this option\n" 208 " can be used to set the maximum number of threads.\n" 209 " By default OpenMP uses all processors/cores.\n" 210 "-o, --outdir Set the output directory for the report\n" 211 " file and for other output files with relative paths.\n" 212 " Default is the current directory.\n" 213 "-p --plain Generate plain help output suitable for\n" 214 " script processing.\n" 215 "-r, --reporting Three digit integer. Sets the reporting\n" 216 " level for agenda calls (first digit),\n" 217 " screen (second digit) and file (third \n" 218 " digit). All reporting levels can reach from 0\n" 219 " (only error messages) to 3 (everything).\n" 220 " The agenda setting applies in addition to both\n" 221 " screen and file output.\n" 223 #ifdef ENABLE_DOCSERVER 224 "-s, --docserver Start documentation server. Optionally, specify\n" 225 " the port number the server should listen on,\n" 226 " e.g. arts -s9999 or arts --docserver=9999.\n" 227 " Default is 9000.\n" 228 "-S, --docdaemon Start documentation server in the background.\n" 229 "-U, --baseurl Base URL for the documentation server.\n" 231 "-v, --version Show version information.\n" 232 "-w, --workspacevariables If this is given the argument 'all',\n" 233 " it simply prints a list of all variables.\n" 234 " If it is given the name of a method, it\n" 235 " prints all variables needed by this method.";
249 while (NULL != longopts[i].
name )
251 char c = (char)longopts[i].
val;
276 while ( EOF != (optc =
getopt_long (argc, argv, shortopts.c_str(),
277 longopts, (
int *) 0) ) )
283 parameters.
help =
true;
295 parameters.
gui =
true;
311 istringstream iss(
optarg);
313 if ( iss.bad() || !iss.eof() )
315 cerr <<
"Argument to --numthreads (-n) must be an integer!\n";
324 parameters.
plain =
true;
329 istringstream iss(
optarg);
336 if ( iss.bad() || !iss.eof() )
338 cerr <<
"Argument to --reporting (-r) must be an integer!\n";
347 istringstream iss(
optarg);
349 if ( iss.bad() || !iss.eof() )
351 cerr <<
"Argument to --docserver (-s) must be an integer!\n";
363 istringstream iss(
optarg);
365 if ( iss.bad() || !iss.eof() )
367 cerr <<
"Argument to --docdaemon (-S) must be an integer!\n";
409 #ifdef ARTS_DEFAULT_INCLUDE_DIR 420 parameters.
includepath.push_back (arts_default_include_path.substr (lastPos, pos - lastPos));
421 lastPos = arts_default_include_path.find_first_not_of(
":", pos);
422 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.
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.
The implementation for String, the ARTS string class.
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.