boostorg / boostorg/program_options

Program options default has unreasonable precision

Offen
#85 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
136
Forks
117
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Source code:
``` int i,e,t,d;
time_t now,then;
double tolerance,stageTolerance,areadone,rmsadj;
bool done=false;
string inputFile,outputFile;
bool validArgs,validCmd=true;
po::options_description generic("Options");
po::options_description hidden("Hidden options");
po::options_description cmdline_options;
po::positional_options_description p;
po::variables_map vm;
generic.add_options()
("tolerance,t",po::value(&tolerance)->default_value(0.1),"Vertical tolerance")
("output,o",po::value(&outputFile),"Output file");
hidden.add_options()
("input",po::value(&inputFile),"Input file");
p.add("input",1);
cmdline_options.add(generic).add(hidden);
//...
cout<

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start by reproducing the formatting with the shown Boost.Program_options configuration and inspect how default_value formats a double for the displayed option description. Compare the behavior with ldecimal.cpp in the linked bezitopo project, while preserving the requested 0.1 form rather than .1. Done means the default is displayed as (=0.1) without breaking other option output.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.