Re: [Boost-bugs] [Boost C++ Libraries] #2613: Default arguments break word-wrapping.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2613: Default arguments break word-wrapping.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-12-24 17:12:08


#2613: Default arguments break word-wrapping.
---------------------------+------------------------------------------------
  Reporter: Peter Simons | Owner: vladimir_prus
      Type: Bugs | Status: new
 Milestone: Boost 1.38.0 | Component: program_options
   Version: Boost 1.37.0 | Severity: Problem
Resolution: | Keywords:
---------------------------+------------------------------------------------

Comment(by Peter Simons):

 With Boost 1.37.0, the attached program generates the following output:

 {{{
 $ g++ test.cpp -lboost_program_options && ./a.out
 | Supported options:
 | --help this is a sufficiently long text to
 requ
 | ire word-wrapping
 }}}

 Look closely at the description of the "--help" option. You'll find that
 word-wrapping is performed in the middle of the word, i.e. "require" is
 broken apart as "requ-ire". This is contrary to what I expect because of
 the rules of syllabication, which you'll find described at
 http://en.wikipedia.org/wiki/Syllabification. Now, those rules are
 somewhat complex and might be considered beyond the scope of a command-
 line argument parsing library. Thus, most code that needs to perform word-
 wrapping opts to use a simpler approximation, i.e. to break lines apart at
 *whitespace*. If you check out your source code,
 "options_description.cpp", you'll find that you have implemented an
 algorithm that does this, but unfortunately it appears that your code
 fails to take the length of the default argument into account. I say this
 because the algorithm works just fine when there's no default argument.
 When there is one, word-wrapping does not work fine.

 If you need further clarification, please don't hesitate to ask.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2613#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC