48 Info<<
".SH \"SEE ALSO\"" <<
nl
49 <<
"Online documentation "
50 <<
"https://www.openfoam.com/documentation/" <<
nl
51 <<
".SH COPYRIGHT" <<
nl
52 <<
"Copyright \\(co 2018-" <<
apiYear() <<
" OpenCFD Ltd." <<
nl;
61 const string& optUsage
64 Info<<
".TP\n\\fB\\-" << optName <<
"\\fR";
68 Info<<
" \\fI" << optArg.c_str() <<
"\\fR";
87 const string& optUsage
107 Info<<
"\\fB[Parallel option]\\fR" <<
nl;
115 std::string::size_type start,
151 const string& optArg,
152 const string& optUsage
155 Info<<
" -" << optName;
158 std::string::size_type len = optName.size() + 3;
162 Info<<
" <" << optArg.c_str() <<
'>';
165 len += optArg.size() + 3;
176 const string& optUsage
218 Info<<
".SH \"NAME\"" <<
nl
220 <<
" \\- part of \\fBOpenFOAM\\fR (The Open Source CFD Toolbox)."
227 Info<<
".SH \"SYNOPSIS\"" <<
nl
228 <<
"\\fB" << executable_ <<
"\\fR [\\fIOPTIONS\\fR]";
240 for (
const std::string& argName :
validArgs)
243 Info <<
"\\fI" << argName.c_str() <<
"\\fR";
256 Info<<
".SH \"DESCRIPTION\"" <<
nl;
262 Info<<
"No description available\n";
266 for (
const std::string& note :
notes)
286 Info<<
".SH \"ARGUMENTS\"" <<
nl;
289 for (
const std::string& argName :
validArgs)
293 Info<<
".TP\n\\fI" << argName.c_str() <<
"\\fR";
312 Info<<
".SH \"OPTIONS\"" <<
nl;
331 Info<<
".SS \"ADVANCED OPTIONS\"" <<
nl;
345 const bool hasCompat =
353 printManOption(
"help-compat",
"Display compatibility options and exit");
356 printManOption(
"help-man",
"Display full help (manpage format) and exit");
357 printManOption(
"help-notes",
"Display help notes (description) and exit");
368 Info<<
"\nUsage: " << executable_ <<
" [OPTIONS]";
370 if (validArgs.size())
380 for (
const std::string& argName : validArgs)
383 Info<<
'<' << argName.c_str() <<
'>';
396 if (validArgs.size() && argUsage.size())
398 Info<<
"Arguments:\n";
401 for (
const std::string& argName : validArgs)
405 Info<<
" <" << argName.c_str() <<
'>';
410 (argName.size() + 4),
418 for (
const word& optName : validOptions.sortedToc())
421 if (full || !advancedOptions.found(optName))
430 printOption(
"doc",
"Display documentation in browser");
433 printOption(
"doc-source",
"Display source code in browser");
435 printOption(
"help",
"Display short help and exit");
443 printOption(
"help-compat",
"Display compatibility options and exit");
448 printOption(
"help-man",
"Display full help (manpage format) and exit");
449 printOption(
"help-notes",
"Display help notes (description) and exit");
452 printOption(
"help-full",
"Display full help and exit");
469 for (
const std::string& note : notes)
484void Foam::argList::printManCompat()
const
497 Info<<
".SS \"COMPATIBILITY OPTIONS\"" <<
nl;
503 const word& optName = iter.first;
504 const int until = abs(iter.second);
506 Info<<
".TP\n\\fB\\-" <<
k
507 <<
"\\fR (now \\fB\\-" << optName <<
"\\fR)" <<
nl;
511 Info<<
"The option was last used in " << until <<
"." <<
nl;
519 const bool hasArg = iter.first;
520 const int until = abs(iter.second);
522 Info<<
".TP\n\\fB\\-" <<
k <<
"\\fR";
526 Info<<
" \\fIarg\\fR";
529 Info<<
nl <<
"This option is ignored";
533 Info<<
" after " << until <<
".";
548 Info<< nopt <<
" compatibility options for " << executable_ <<
nl;
555 const int col1(32), col2(32);
558 <<
"|" <<
setf(ios_base::left) <<
setw(col1) <<
" Old option"
559 <<
"|" <<
setf(ios_base::left) <<
setw(col2) <<
" New option"
560 <<
"| Comment" <<
nl;
564 <<
"|" <<
setf(ios_base::left) <<
setw(col2) <<
""
565 <<
"|------------" <<
nl;
573 const word& optName = iter.first;
574 const int until = abs(iter.second);
577 <<
"| -" <<
setf(ios_base::left) <<
setw(col2-2) << optName
582 Info<<
" until " << until;
591 const bool hasArg = iter.first;
592 const int until = abs(iter.second);
598 Info<< (
k +
" <arg>").c_str();
606 Info<<
setf(ios_base::left) <<
setw(col2-1) <<
"ignored" <<
"|";
609 Info<<
" after " << until;
616 <<
"|" <<
setf(ios_base::left) <<
setw(col2) <<
""
617 <<
"|------------" <<
nl;
Istream and Ostream manipulators taking arguments.
bool empty() const noexcept
True if the hash table is empty.
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
static HashTable< string, label, Hash< label > > argUsage
Short description for program arguments.
static std::string::size_type usageMin
Min indentation when displaying usage (default: 20)
static HashTable< std::pair< word, int > > validOptionsCompat
A list of aliases for options.
static HashTable< string > validParOptions
A list of valid parallel options.
static std::string::size_type usageMax
Max screen width when displaying usage (default: 80)
void printUsage(bool full=true) const
Print usage.
static HashTable< string > optionUsage
Short description for validOptions.
static HashSet< string > advancedOptions
The "advanced" options are shown with -help-full (not with –help)
static SLList< string > notes
General usage notes.
void printCompat() const
Print option compatibility.
void printMan() const
Print usage as nroff-man format (Experimental)
void printNotes() const
Print notes (if any)
static HashTable< string > validOptions
A list of valid options.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
static HashTable< std::pair< bool, int > > ignoreOptionsCompat
A list of options to ignore.
std::ostream & stdStream()
Return std::ostream for output operations.
Lookup type of boundary radiation properties.
A class for handling words, derived from Foam::string.
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
void printBuildInfo(std::ostream &os, const bool full=true)
Print information about version, build, arch to output stream.
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.
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
static void printOption(const word &optName, const string &optArg, const string &optUsage)
static void printManFooter()
static void printManOption(const word &optName, const string &optArg, const string &optUsage)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Omanip< int > setw(const int i)
static void printOptionUsage(std::string::size_type start, const string &str)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Omanip< char > setfill(char fillch)
constexpr char nl
The newline '\n' character (0x0a)