Skip to content

Commit 2a16575

Browse files
committed
Merge from trunk. No code changes, only properties and docs and examples
[SVN r47336]
1 parent f14a369 commit 2a16575

File tree

3 files changed

+11
-20
lines changed

3 files changed

+11
-20
lines changed

doc/overview.xml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,16 +185,14 @@ desc.add_options()
185185
("email", value<string>()->multitoken(), "email to send to")
186186
;
187187
</programlisting>
188-
For the first option (<literal>help</literal>), we specify only the name
189-
and the description. No value can be specified in the parsed source.
190-
For the second option (<literal>compression</literal>), the user must
191-
specify a value, using a single token. For the third option
192-
(<literal>verbose</literal>), the user may either provide a single token
193-
for the value, or no token at all. For the last option
194-
(<literal>email</literal>), the value can span several tokens. For
195-
example, the following command line is OK:
188+
For the first parameter, we specify only the name and the
189+
description. No value can be specified in the parsed source.
190+
For the first option, the user must specify a value, using a single
191+
token. For the third option, the user may either provide a single token
192+
for the value, or no token at all. For the last option, the value can
193+
span several tokens. For example, the following command line is OK:
196194
<screen>
197-
test --help --compression 10 --verbose --email beagle@mars beagle2@mars
195+
test --help --compression 10 --verbose --email beadle@mars beadle2@mars
198196
</screen>
199197
</para>
200198

example/first.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,23 @@ int main(int ac, char* av[])
2121
desc.add_options()
2222
("help", "produce help message")
2323
("compression", po::value<int>(), "set compression level")
24-
("verbose", po::value<string>()->zero_tokens()->implicit_value(""))
2524
;
2625

27-
po::variables_map vm;
26+
po::variables_map vm;
2827
po::store(po::parse_command_line(ac, av, desc), vm);
29-
po::notify(vm);
28+
po::notify(vm);
3029

3130
if (vm.count("help")) {
3231
cout << desc << "\n";
3332
return 1;
3433
}
3534

3635
if (vm.count("compression")) {
37-
cout << "Compression level was set to "
36+
cout << "Compression level was set to "
3837
<< vm["compression"].as<int>() << ".\n";
3938
} else {
4039
cout << "Compression level was not set.\n";
4140
}
42-
43-
if (vm.count("verbose")) {
44-
string v = vm["verbose"].as<string>();
45-
if (v.size() > 0)
46-
cout << "Verbosity is: " << v << ".\n";
47-
}
4841
}
4942
catch(exception& e) {
5043
cerr << "error: " << e.what() << "\n";

example/options_description.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ using namespace std;
1818
template<class T>
1919
ostream& operator<<(ostream& os, const vector<T>& v)
2020
{
21-
copy(v.begin(), v.end(), ostream_iterator<T>(os, " "));
21+
copy(v.begin(), v.end(), ostream_iterator<T>(cout, " "));
2222
return os;
2323
}
2424

0 commit comments

Comments
 (0)