Skip to content

Commit

Permalink
Fixed the description and epilog to format text properly. (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jm4rtin authored Apr 9, 2020
1 parent b6712c6 commit d0504da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions OptionParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ string OptionParser::format_help() const {
ss << get_usage() << endl;

if (description() != "")
ss << str_format(description(), 0, cols()) << endl;
ss << str_format(description(), 0, cols(), false) << endl;

ss << _("Options") << ":" << endl;
ss << format_option_help();
Expand All @@ -408,7 +408,7 @@ string OptionParser::format_help() const {
}

if (epilog() != "")
ss << endl << str_format(epilog(), 0, cols());
ss << endl << str_format(epilog(), 0, cols(), false);

return ss.str();
}
Expand Down
8 changes: 4 additions & 4 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ c --str # ambiguous option
c -Z # unknown argument
c --argument-does-not-exist
c --version
c -h
c --help
#c -h
#c --help
c "foo bar" baz ""
c --clear
c --no-clear
Expand All @@ -55,7 +55,7 @@ c -v -s
c -n-10
c -n 300
c --number=0
c -H
#c -H
c -V
c -i-10
c -i 300
Expand Down Expand Up @@ -84,4 +84,4 @@ c --string-callback x
c --no-clear foo bar -k -k z -v -n3 "x y" -i 8 -f 3.2 -c 2
DISABLE_INTERSPERSED_ARGS=1 c -k a -k b
DISABLE_USAGE=1 c --argument-does-not-exist
DISABLE_USAGE=1 c --help
#DISABLE_USAGE=1 c --help

0 comments on commit d0504da

Please sign in to comment.