From 5ccb8495419cb9fb8335caebb497652eb665d3f8 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Mon, 12 Oct 2020 07:26:52 +0200 Subject: [PATCH] [A/U] Change from ValueArg<bool> to SwitchArg. --- Applications/Utils/FileConverter/GocadSGridReader.cpp | 6 ++---- Applications/Utils/FileConverter/OGS2VTK.cpp | 7 +++---- .../CreateBoundaryConditionsAlongPolylines.cpp | 3 +-- .../Utils/MeshEdit/MapGeometryToMeshSurface.cpp | 8 ++++---- .../Utils/MeshEdit/createLayeredMeshFromRasters.cpp | 6 ++---- .../MeshGeoTools/constructMeshesFromGeometry.cpp | 11 +++-------- .../Utils/MeshGeoTools/identifySubdomains.cpp | 10 ++-------- .../createMeshElemPropertiesFromASCRaster.cpp | 10 +++------- 8 files changed, 20 insertions(+), 41 deletions(-) diff --git a/Applications/Utils/FileConverter/GocadSGridReader.cpp b/Applications/Utils/FileConverter/GocadSGridReader.cpp index ba5b3bf282e..6d271fd62c3 100644 --- a/Applications/Utils/FileConverter/GocadSGridReader.cpp +++ b/Applications/Utils/FileConverter/GocadSGridReader.cpp @@ -40,10 +40,8 @@ int main(int argc, char* argv[]) "(http://www.opengeosys.org)", ' ', GitInfoLib::GitInfo::ogs_version); - TCLAP::ValueArg<bool> face_set_arg( - "f", "generate-face-sets", - "generate face sets; default false, i.e. do not generate face sets", - false, false, "true/false"); + TCLAP::SwitchArg face_set_arg("f", "generate-face-sets", + "Generate face sets."); cmd.add(face_set_arg); TCLAP::ValueArg<std::string> mesh_output_arg( diff --git a/Applications/Utils/FileConverter/OGS2VTK.cpp b/Applications/Utils/FileConverter/OGS2VTK.cpp index 144b69c4ad2..1b31b9d361d 100644 --- a/Applications/Utils/FileConverter/OGS2VTK.cpp +++ b/Applications/Utils/FileConverter/OGS2VTK.cpp @@ -41,11 +41,10 @@ int main (int argc, char* argv[]) "the name of the file the mesh will be written to", true, "", "file name of output mesh"); cmd.add(mesh_out); - TCLAP::ValueArg<bool> use_ascii_arg( + TCLAP::SwitchArg use_ascii_arg( "", "ascii_output", - "Use ascii format for data in the vtu output. Due to possible rounding " - "the ascii output could result in lower accuracy.", - false, false, "boolean value"); + "Write VTU output in ASCII format. Due to possible rounding the ascii " + "output could result in lower accuracy."); cmd.add(use_ascii_arg); cmd.parse(argc, argv); diff --git a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp index 773e8c4b719..14c0c5b8d51 100644 --- a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp +++ b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp @@ -133,8 +133,7 @@ int main (int argc, char* argv[]) "Copyright (c) 2012-2020, OpenGeoSys Community " "(http://www.opengeosys.org)", ' ', GitInfoLib::GitInfo::ogs_version); - TCLAP::ValueArg<bool> gml_arg("", "gml", - "if switched on write found nodes to file in gml format", false, false, "bool"); + TCLAP::SwitchArg gml_arg("", "gml", "Write found nodes to gml file."); cmd.add(gml_arg); TCLAP::ValueArg<std::string> output_base_fname("o", "output-base-file-name", diff --git a/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp b/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp index 855d6fafa10..be5b9e6ddfa 100644 --- a/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp +++ b/Applications/Utils/MeshEdit/MapGeometryToMeshSurface.cpp @@ -42,10 +42,10 @@ int main (int argc, char* argv[]) "the name of the file containing the input geometry", true, "", "file name"); cmd.add(input_geometry_fname); - TCLAP::ValueArg<bool> additional_insert_mapping("a", "additional-insert-mapping", - "if true advanced mapping algorithm will be applied, i.e. a new " - "geometry will be created and possibly new points will be inserted.", false, - true, "boolean value"); + TCLAP::SwitchArg additional_insert_mapping( + "a", "additional-insert-mapping", + "Advanced mapping algorithm will be applied, i.e. a new geometry will " + "be created and possibly new points will be inserted."); cmd.add(additional_insert_mapping); TCLAP::ValueArg<std::string> output_geometry_fname("o", "output-geometry", "the name of the file containing the input geometry", true, diff --git a/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp b/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp index 75ebee15816..117780c09d5 100644 --- a/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp +++ b/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp @@ -70,10 +70,8 @@ int main (int argc, char* argv[]) "(http://www.opengeosys.org)", ' ', GitInfoLib::GitInfo::ogs_version); - TCLAP::ValueArg<bool> use_ascii_arg( - "", "ascii_output", - "Use ascii format for VTU output.", - false, false, "true/false"); + TCLAP::SwitchArg use_ascii_arg("", "ascii_output", + "Write VTU output in ASCII format."); cmd.add(use_ascii_arg); double min_thickness(std::numeric_limits<double>::epsilon()); diff --git a/Applications/Utils/MeshGeoTools/constructMeshesFromGeometry.cpp b/Applications/Utils/MeshGeoTools/constructMeshesFromGeometry.cpp index 2e9d0fc399d..1970b3ed03a 100644 --- a/Applications/Utils/MeshGeoTools/constructMeshesFromGeometry.cpp +++ b/Applications/Utils/MeshGeoTools/constructMeshesFromGeometry.cpp @@ -69,14 +69,9 @@ int main(int argc, char* argv[]) "mesh file name"); cmd.add(mesh_arg); - TCLAP::ValueArg<bool> multiple_nodes_allowed_arg( - "", - "multiple-nodes-allowed", - "allows that multiple mesh nodes are contained in the eps environment", - false, // required argument - false, // default value - "allows that multiple mesh nodes are contained in the eps environment, " - "the nearest node for a point will be returned"); + TCLAP::SwitchArg multiple_nodes_allowed_arg( + "", "multiple-nodes-allowed", + "Allows multiple mesh nodes in eps environment."); cmd.add(multiple_nodes_allowed_arg); cmd.parse(argc, argv); diff --git a/Applications/Utils/MeshGeoTools/identifySubdomains.cpp b/Applications/Utils/MeshGeoTools/identifySubdomains.cpp index 3f31acc0f6b..91d5bc053ea 100644 --- a/Applications/Utils/MeshGeoTools/identifySubdomains.cpp +++ b/Applications/Utils/MeshGeoTools/identifySubdomains.cpp @@ -54,14 +54,8 @@ int main(int argc, char* argv[]) "(http://www.opengeosys.org)", ' ', GitInfoLib::GitInfo::ogs_version); - TCLAP::ValueArg<bool> force_overwrite_arg( - "f", - "force", - "Overwrites the existing subdomain meshes. (default: 0, do not " - "overwrite.)", - false, - false, - "1/0"); + TCLAP::SwitchArg force_overwrite_arg( + "f", "force", "Overwriting existing subdomain meshes."); cmd.add(force_overwrite_arg); TCLAP::ValueArg<std::string> output_prefix_arg( diff --git a/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp b/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp index 3a103ca06e6..ec913fbad13 100644 --- a/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp +++ b/Applications/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp @@ -52,13 +52,9 @@ int main(int argc, char* argv[]) "filename for mesh output"); cmd.add(out_mesh_arg); - TCLAP::ValueArg<bool> refinement_raster_output_arg( - "", - "output-refined-raster", - "write refined raster to a new ASC file", - false, - false, - "0"); + TCLAP::SwitchArg refinement_raster_output_arg( + "", "output-refined-raster", + "Write refined raster to an additional, new ASC file."); cmd.add(refinement_raster_output_arg); TCLAP::ValueArg<unsigned> refinement_arg( -- GitLab