bfgroup / Lyra

A simple to use, composable, command line parser for C++ 11 and beyond
https://bfgroup.github.io/Lyra/
Boost Software License 1.0
483 stars 58 forks source link

Long text wrapping in the help output #59

Open lahwaacz opened 2 years ago

lahwaacz commented 2 years ago

The length of the "help" strings for options is not limited, but the implementation assumes that they are somewhat short, else the help output looks pretty ugly when it is wrapped in a terminal. For example (hard-wrapped manually to show the issue in HTML):

...

OPTIONS, ARGUMENTS:
  -?, -h, --help
  --detect-features       Before mesh generation, detect sharp features and boundaries of the
internal bounding polyhedron (and the potential internal polyhedron) and inserts them as features
of the domain. Default value: 0.
  --features-angle-bound <SCALAR>
                          The maximum angle (in degrees) between the two normal vectors of adjacent
triangles. For an edge of the polyhedron, if the angle between the two normal vectors of its
incident facets is bigger than the given bound, then the edge is considered as a feature edge.
Default value: 60.
  --edge-size <SCALAR>    A constant providing a uniform upper bound for the lengths of curve edges.
This parameter has to be set to a positive value when 1-dimensional features protection is used.
Default value: 1.
  --facet-angle <SCALAR>  A lower bound for the angles (in degrees) of the surface mesh facets.
Default value: 25.
  --facet-size <SCALAR>   A constant describing a uniform upper-bound or for the radii of the
surface Delaunay balls. Default value: 1.
  --facet-distance <SCALAR>
                          A constant describing a uniform upper bound for the distance between the
facet circumcenter and the center of its surface Delaunay ball. Default value: 0.125.

Instead, Lyra should do the wrapping and print something like this:

OPTIONS, ARGUMENTS:
  -?, -h, --help
  --detect-features       Before mesh generation, detect sharp features and boundaries of the
                          internal bounding polyhedron (and the potential internal polyhedron) and
                          inserts them as features of the domain. Default value: 0.
  --features-angle-bound <SCALAR>
                          The maximum angle (in degrees) between the two normal vectors of adjacent
                          triangles. For an edge of the polyhedron, if the angle between the two
                          normal vectors of its incident facets is bigger than the given bound,
                          then the edge is considered as a feature edge.  Default value: 60.
  --edge-size <SCALAR>    A constant providing a uniform upper bound for the lengths of curve edges.
                          This parameter has to be set to a positive value when 1-dimensional
                          features protection is used.  Default value: 1.
  --facet-angle <SCALAR>  A lower bound for the angles (in degrees) of the surface mesh facets.
                          Default value: 25.
  --facet-size <SCALAR>   A constant describing a uniform upper-bound or for the radii of the
                          surface Delaunay balls. Default value: 1.
  --facet-distance <SCALAR>
                          A constant describing a uniform upper bound for the distance between the
                          facet circumcenter and the center of its surface Delaunay ball. Default
                          value: 0.125.