Go to the documentation of this file.
47 Info<<
".SH \"SEE ALSO\"" <<
nl
48 <<
"Online documentation "
49 <<
"https://www.openfoam.com/documentation/" <<
nl
50 <<
".SH COPYRIGHT" <<
nl
51 <<
"Copyright \\(co 2018-" <<
apiYear() <<
" OpenCFD Ltd." <<
nl;
58 Info<<
".TP\n\\fB\\-" << optName <<
"\\fR";
63 if (optIter.found() && optIter().size())
65 Info<<
" \\fI" << optIter().c_str() <<
"\\fR";
72 if (usageIter.found())
82 Info<<
"\\fB[Parallel option]\\fR" <<
nl;
90 Info<<
".TP\n\\fB\\-" << optName <<
"\\fR" <<
nl
132 Info<<
" -" << optName;
135 label len = optName.size() + 3;
138 if (optIter.found() && optIter().size())
141 len += optIter().size() + 3;
142 Info<<
" <" << optIter().c_str() <<
'>';
146 if (usageIter.found())
158 static inline void printOption(
const char* optName,
const char* optUsage)
160 Info<<
" -" << optName;
187 Info<<
".SH \"NAME\"" <<
nl
189 <<
" \\- part of \\fBOpenFOAM\\fR (The Open Source CFD Toolbox)."
196 Info<<
".SH \"SYNOPSIS\"" <<
nl
197 <<
"\\fB" << executable_ <<
"\\fR [\\fIOPTIONS\\fR]";
209 for (
const std::string& argName :
validArgs)
212 Info <<
"\\fI" << argName.c_str() <<
"\\fR";
225 Info<<
".SH \"DESCRIPTION\"" <<
nl;
231 Info<<
"No description available\n";
235 for (
const std::string& note :
notes)
255 Info<<
".SH \"ARGUMENTS\"" <<
nl;
258 for (
const std::string& argName :
validArgs)
262 Info<<
".TP\n\\fI" << argName.c_str() <<
"\\fR";
268 if (usageIter.found())
281 Info<<
".SH \"OPTIONS\"" <<
nl;
300 Info<<
".SS \"ADVANCED OPTIONS\"" <<
nl;
314 const bool hasCompat =
322 printManOption(
"help-compat",
"Display compatibility options and exit");
325 printManOption(
"help-man",
"Display full help (manpage format) and exit");
326 printManOption(
"help-notes",
"Display help notes (description) and exit");
337 Info<<
"\nUsage: " << executable_ <<
" [OPTIONS]";
339 if (validArgs.size())
349 for (
const std::string& argName : validArgs)
352 Info<<
'<' << argName.c_str() <<
'>';
365 if (validArgs.size() && argUsage.size())
367 Info<<
"Arguments:\n";
370 for (
const std::string& argName : validArgs)
374 Info<<
" <" << argName.c_str() <<
'>';
377 if (usageIter.found())
379 const label len = argName.size() + 4;
392 for (
const word& optName : validOptions.sortedToc())
395 if (full || !advancedOptions.found(optName))
404 printOption(
"doc",
"Display documentation in browser");
407 printOption(
"doc-source",
"Display source code in browser");
409 printOption(
"help",
"Display short help and exit");
417 printOption(
"help-compat",
"Display compatibility options and exit");
422 printOption(
"help-man",
"Display full help (manpage format) and exit");
423 printOption(
"help-notes",
"Display help notes (description) and exit");
426 printOption(
"help-full",
"Display full help and exit");
443 for (
const std::string& note : notes)
458 void Foam::argList::printManCompat()
const
471 Info<<
".SS \"COMPATIBILITY OPTIONS\"" <<
nl;
477 const word& optName = iter.first;
478 const int until = abs(iter.second);
480 Info<<
".TP\n\\fB\\-" <<
k
481 <<
"\\fR (now \\fB\\-" << optName <<
"\\fR)" <<
nl;
485 Info<<
"The option was last used in " << until <<
"." <<
nl;
493 const bool hasArg = iter.first;
494 const int until = abs(iter.second);
496 Info<<
".TP\n\\fB\\-" <<
k <<
"\\fR";
500 Info<<
" \\fIarg\\fR";
503 Info<<
nl <<
"This option is ignored";
507 Info<<
" after " << until <<
".";
522 Info<< nopt <<
" compatibility options for " << executable_ <<
nl;
529 const int col1(32), col2(32);
532 <<
"|" <<
setf(ios_base::left) <<
setw(col1) <<
" Old option"
533 <<
"|" <<
setf(ios_base::left) <<
setw(col2) <<
" New option"
534 <<
"| Comment" <<
nl;
538 <<
"|" <<
setf(ios_base::left) <<
setw(col2) <<
""
539 <<
"|------------" <<
nl;
547 const word& optName = iter.first;
548 const int until = abs(iter.second);
551 <<
"| -" <<
setf(ios_base::left) <<
setw(col2-2) << optName
556 Info<<
" until " << until;
565 const bool hasArg = iter.first;
566 const int until = abs(iter.second);
572 Info<< (
k +
" <arg>").c_str();
580 Info<<
setf(ios_base::left) <<
setw(col2-1) <<
"ignored" <<
"|";
583 Info<<
" after " << until;
590 <<
"|" <<
setf(ios_base::left) <<
setw(col2) <<
""
591 <<
"|------------" <<
nl;
static SLList< string > validArgs
A list of valid (mandatory) arguments.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
void printMan() const
Print usage as nroff-man format (Experimental)
static std::string::size_type usageMin
Min indentation when displaying usage (default: 20)
A class for handling words, derived from Foam::string.
static std::string::size_type usageMax
Max screen width when displaying usage (default: 80)
static HashTable< std::pair< word, int > > validOptionsCompat
A list of aliases for options.
void writeWrapped(OSstream &os, const std::string &str, const std::string::size_type width, const std::string::size_type indent=0, const bool escape=false)
Output string with text wrapping.
static HashTable< string > optionUsage
Short description for validOptions.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void printCompat() const
Print option compatibility.
void printBuildInfo(std::ostream &os, const bool full=true)
Print information about version, build, arch to output stream.
static HashTable< string > validParOptions
A list of valid parallel options.
void printNotes() const
Print notes (if any)
messageStream Info
Information stream (uses stdout - output is on the master only)
Istream and Ostream manipulators taking arguments.
graph_traits< Graph >::vertices_size_type size_type
static HashTable< string > validOptions
A list of valid options.
Omanip< int > setw(const int i)
static void printOption(const word &optName)
static HashSet< string > advancedOptions
The "advanced" options are shown with -help-full (not with –help)
static void printOptionUsage(std::string::size_type start, const string &str)
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
static void printManFooter()
Omanip< char > setfill(char fillch)
label k
Boltzmann constant.
static SLList< string > notes
General usage notes.
bool empty() const noexcept
True if the hash table is empty.
static HashTable< std::pair< bool, int > > ignoreOptionsCompat
A list of options to ignore.
static HashTable< string, label, Hash< label > > argUsage
Short description for program arguments.
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
static void printManOption(const word &optName)
void printUsage(bool full=true) const
Print usage.