37 char *envval = getenv(envvar.c_str());
47 paths.push_back(pathstring.substr(lastPos, pos - lastPos));
48 lastPos = pathstring.find_first_not_of(
":", pos);
49 pos = pathstring.find_first_of(
":", lastPos);
100 struct option longopts[] = {
122 "Usage: arts [-bBdghimnrsSvw]\n"
123 " [--basename <name>]\n"
124 " [--describe <method or variable>]\n"
127 " [--includepath <path>]\n"
128 " [--datapath <path>]\n"
129 " [--input <variable>]\n"
130 " [--methods all|<variable>]\n"
131 " [--numthreads <#>\n"
132 " [--outdir <name>]\n"
134 " [--reporting <xyz>]\n"
135#ifdef ENABLE_DOCSERVER
136 " [--docserver[=<port>] --baseurl=BASEURL]\n"
137 " [--docdaemon[=<port>] --baseurl=BASEURL]\n"
139 " [--workspacevariables all|<method>]\n"
140 " file1.arts file2.arts ...";
143 "The Atmospheric Radiative Transfer Simulator.\n\n"
144 "-b, --basename Set the basename for the report\n"
145 " file and for other output files.\n"
146 "-d, --describe Print the description String of the given\n"
147 " workspace variable or method.\n"
148 "-g --groups List all workspace variable groups.\n"
149 "-h, --help Print this message.\n"
150 "-i, --input This is complementary to the --methods switch.\n"
151 " It must be given the name of a variable (or group).\n"
152 " Then it lists all methods that take this variable\n"
153 " (or group) as input.\n"
154 "-I --includepath Search path for include files. Can be given more\n"
155 " than once to add several paths.\n"
156 " Include paths can also be added by setting the\n"
157 " environment variable ARTS_INCLUDE_PATH. Multiple\n"
158 " paths have to be separated by colons.\n"
159 " Paths specified on the commandline have precedence\n"
160 " over the environment variable and will be searched\n"
162 "-D --datapath Additional search path for data files. Directories\n"
163 " specified here will be searched after the includepath.\n"
164 " Data paths can also be added by setting the\n"
165 " environment variable ARTS_DATA_PATH.\n"
166 "-m, --methods If this is given the argument 'all',\n"
167 " it simply prints a list of all methods.\n"
168 " If it is given the name of a variable\n"
169 " (or variable group), it prints all\n"
170 " methods that produce this\n"
171 " variable (or group) as output.\n"
172 "-n, --numthreads If arts was compiled with OpenMP support this option\n"
173 " can be used to set the maximum number of threads.\n"
174 " By default OpenMP uses all processors/cores.\n"
175 "-o, --outdir Set the output directory for the report\n"
176 " file and for other output files with relative paths.\n"
177 " Default is the current directory.\n"
178 "-p --plain Generate plain help output suitable for\n"
179 " script processing.\n"
180 "-r, --reporting Three digit integer. Sets the reporting\n"
181 " level for agenda calls (first digit),\n"
182 " screen (second digit) and file (third \n"
183 " digit). All reporting levels can reach from 0\n"
184 " (only error messages) to 3 (everything).\n"
185 " The agenda setting applies in addition to both\n"
186 " screen and file output.\n"
188#ifdef ENABLE_DOCSERVER
189 "-s, --docserver Start documentation server. Optionally, specify\n"
190 " the port number the server should listen on,\n"
191 " e.g. arts -s9999 or arts --docserver=9999.\n"
192 " Default is 9000.\n"
193 "-S, --docdaemon Start documentation server in the background.\n"
194 "-U, --baseurl Base URL for the documentation server.\n"
196 "-v, --version Show version information.\n"
197 "-w, --workspacevariables If this is given the argument 'all',\n"
198 " it simply prints a list of all variables.\n"
199 " If it is given the name of a method, it\n"
200 " prints all variables needed by this method.\n"
201#ifdef ENABLE_DOCSERVER
202 "\nDEVELOPER ONLY:\n\n"
203 "-C, --check-docs Check for broken links in built-in docs.\n"
219 while (NULL != longopts[i].
name) {
220 char c = (char)longopts[i].
val;
244 argc, argv, shortopts.c_str(), longopts, (
int *)0))) {
275 istringstream iss(
optarg);
277 if (iss.bad() || !iss.eof()) {
278 cerr <<
"Argument to --numthreads (-n) must be an integer!\n";
291 istringstream iss(
optarg);
298 if (iss.bad() || !iss.eof()) {
299 cerr <<
"Argument to --reporting (-r) must be an integer!\n";
304#ifdef ENABLE_DOCSERVER
310 istringstream iss(
optarg);
312 if (iss.bad() || !iss.eof()) {
313 cerr <<
"Argument to --docserver (-s) must be an integer!\n";
322 istringstream iss(
optarg);
324 if (iss.bad() || !iss.eof()) {
325 cerr <<
"Argument to --docdaemon (-S) must be an integer!\n";
338 case 'C': [[fallthrough]];
339 case 's': [[fallthrough]];
340 case 'S': [[fallthrough]];
342 cerr <<
"This version of ARTS was compiled without documentation "
375#ifdef ARTS_DEFAULT_INCLUDE_DIR
380 arts_default_include_path.find_first_not_of(
":", 0);
383 arts_default_include_path.find_first_of(
":", lastPos);
387 arts_default_include_path.substr(lastPos, pos - lastPos));
388 lastPos = arts_default_include_path.find_first_not_of(
":", pos);
389 pos = arts_default_include_path.find_first_of(
":", lastPos);
void arts_exit(int status)
This is the exit function of ARTS.
The global header file for ARTS.
#define required_argument
#define optional_argument
Index nelem() const ARTS_NOEXCEPT
Structure to hold all command line Parameters.
bool check_docs
Flag to check built-in documentation.
ArrayOfString includepath
List of paths to search for include files.
String helptext
Longer message explaining the options.
String outdir
If this is specified (with the -o –outdir option), it is used as the base directory for the report fi...
bool gui
Flag to run with graphical user interface.
String usage
Short message how to call the program.
bool version
Display version information.
ArrayOfString datapath
List of paths to search for data files.
String workspacevariables
If this is given the argument ‘all’, it simply prints a list of all workspace variables.
String baseurl
Baseurl for the docserver.
String input
This is complementary to the methods switch.
ArrayOfString controlfiles
The filenames of the controlfiles.
bool plain
Generate plain help out suitable for script processing.
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.
bool help
Only display the help text.
Index reporting
This should be a two digit integer.
Index numthreads
The maximum number of threads to use.
Index docserver
Port to use for the docserver.
bool daemon
Flag to run the docserver in the background.
String describe
Print the description String of the given workspace variable or method.
String methods
If this is given the argument ‘all’, it simply prints a list of all methods.
static const Index npos
Define npos:
#define ARTS_DEFAULT_INCLUDE_DIR
String get_dirname(const std::string_view path)
Return the parent directory of a path.
This file contains basic functions to handle ASCII files.
my_basic_string< char > String
The String type for ARTS.
void parse_path_from_environment(String envvar, ArrayOfString &paths)
Parse path environment variable.
bool get_parameters(int argc, char **argv)
Get the command line parameters.
Parameters parameters
Holds the command line parameters.
This file contains header information for the dealing with command line parameters.