From 39814033f754c0ca16930b0acb98fb5ffe4c38b4 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Tue, 29 Jan 2013 14:32:02 +0000 Subject: [PATCH] tweak --- Common/CommandLine.cpp | 6 +++--- Common/CommandLine.h | 2 +- Common/Options.cpp | 4 +++- Fltk/helpWindow.cpp | 4 +++- doc/texinfo/commandline.texi | 21 ++++++++++++++++++--- 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index 0ded201570..3ec33d7a0a 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -43,11 +43,10 @@ const char *GetGmshBuildOS(){ return GMSH_OS; } const char *GetGmshShortLicense(){ return GMSH_SHORT_LICENSE; } const char *GetGmshBuildOptions(){ return GMSH_CONFIG_OPTIONS; } -std::vector<std::pair<std::string, std::string> > GetUsage(const std::string &name) +std::vector<std::pair<std::string, std::string> > GetUsage() { typedef std::pair<std::string, std::string> mp; std::vector<mp> s; - s.push_back(mp("Usage: " + name + " [options] [files]", "")); s.push_back(mp("Geometry options:", "")); s.push_back(mp("-0", "Output unrolled geometry, then exit")); s.push_back(mp("-tol float", "Set geometrical tolerance")); @@ -236,7 +235,8 @@ std::vector<std::pair<std::string, std::string> > GetMouseUsage() void PrintUsage(const std::string &name) { - std::vector<std::pair<std::string, std::string> > s = GetUsage(name); + Msg::Direct("Usage: %s [options] [files]", name.c_str()); + std::vector<std::pair<std::string, std::string> > s = GetUsage(); for(unsigned int i = 0; i < s.size(); i++){ std::string a = s[i].first, b = s[i].second; if(b.empty()){ diff --git a/Common/CommandLine.h b/Common/CommandLine.h index d5f06d16f9..8fb94c9ef1 100644 --- a/Common/CommandLine.h +++ b/Common/CommandLine.h @@ -20,7 +20,7 @@ const char *GetGmshBuildOS(); const char *GetGmshShortLicense(); const char *GetGmshBuildOptions(); -std::vector<std::pair<std::string, std::string> > GetUsage(const std::string &name); +std::vector<std::pair<std::string, std::string> > GetUsage(); std::vector<std::pair<std::string, std::string> > GetShortcutsUsage(const std::string &ctrl=""); std::vector<std::pair<std::string, std::string> > GetMouseUsage(); void PrintUsage(const std::string &name); diff --git a/Common/Options.cpp b/Common/Options.cpp index 5eccefbd8d..c6011cf38a 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -942,11 +942,13 @@ void PrintOptionsDoc() Msg::Error("Unable to open file 'commandline.texi'"); return; } - std::vector<std::pair<std::string, std::string> > s = GetUsage("gmsh"); + std::vector<std::pair<std::string, std::string> > s = GetUsage(); fprintf(file, "%s@ftable @code\n", warn); for(unsigned int i = 0; i < s.size(); i++) if(s[i].first.size() && s[i].second.size()) fprintf(file, "@item %s\n%s\n", s[i].first.c_str(), s[i].second.c_str()); + else if(s[i].first.size() && s[i].second.empty()) + fprintf(file, "@end ftable\n %s\n@ftable @code\n", s[i].first.c_str()); fprintf(file, "@end ftable\n"); fclose(file); } diff --git a/Fltk/helpWindow.cpp b/Fltk/helpWindow.cpp index 630c21a74b..2eb6f58e80 100644 --- a/Fltk/helpWindow.cpp +++ b/Fltk/helpWindow.cpp @@ -291,10 +291,12 @@ helpWindow::helpWindow() s += "<h3>Command Line Switches</h3>"; s += "<table border=1>"; { - std::vector<std::pair<std::string, std::string> > s0 = GetUsage("gmsh"); + std::vector<std::pair<std::string, std::string> > s0 = GetUsage(); for(unsigned int i = 0; i < s0.size(); i++) if(s0[i].first.size() && s0[i].second.size()) s += "<tr><td>" + s0[i].first + "</td><td>" + s0[i].second + "</td></tr>"; + else if(s0[i].first.size() && s0[i].second.empty()) + s += "</table>" + s0[i].first + "<table border=1>"; } s += "</table>"; diff --git a/doc/texinfo/commandline.texi b/doc/texinfo/commandline.texi index bc96fcfdc7..13a55aae4e 100644 --- a/doc/texinfo/commandline.texi +++ b/doc/texinfo/commandline.texi @@ -3,6 +3,9 @@ @c Do not edit by hand! @c +@ftable @code +@end ftable + Geometry options: @ftable @code @item -0 Output unrolled geometry, then exit @@ -10,6 +13,9 @@ Output unrolled geometry, then exit Set geometrical tolerance @item -match Match geometries and meshes +@end ftable + Mesh options: +@ftable @code @item -1, -2, -3 Perform 1D, 2D or 3D mesh generation, then exit @item -format string @@ -20,7 +26,7 @@ Select msh file version Perform uniform mesh refinement, then exit @item -part int Partition after batch mesh generation -@item -partWeight <tri|quad|tet|prism|hex> int +@item -partWeight tri|quad|tet|prism|hex int Weight of a triangle/quad/etc. during partitioning @item -renumber Renumber the mesh elements after batch mesh generation @@ -47,7 +53,7 @@ Min high-order element quality before optim (0.0->1.0) @item -hoNLayers int Number of high order element layers to optimize @item -hoElasticity float -Poisson ration for elasticity analogy (-1.0 < nu < 0.5) +Poisson ration for elasticity analogy (nu in [-1.0,0.5]) @item -optimize[_netgen] Optimize quality of tetrahedral elements @item -optimize_lloyd @@ -78,10 +84,16 @@ Perform various consistency checks on mesh Do several passes on the mesh for complex backround fields @item -ignorePartBound Ignore partitions boundaries +@end ftable + Post-processing options: +@ftable @code @item -link int Select link mode between views (0, 1, 2, 3, 4) @item -combine Combine views having identical names into multi-time-step views +@end ftable + Display options: +@ftable @code @item -n Hide all meshes and post-processing views on startup @item -nodb @@ -96,6 +108,9 @@ Specify display Use camera mode view; @item -stereo OpenGL quad-buffered stereo rendering (requires special graphic card) +@end ftable + Other options: +@ftable @code @item - Parse input files, then exit @item -a, -g, -m, -s, -p @@ -121,5 +136,5 @@ Show version number @item -info Show detailed version information @item -help -Show this message +Show command line usage @end ftable -- GitLab