summaryrefslogtreecommitdiff
path: root/examples/hello/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hello/driver.cxx')
-rw-r--r--examples/hello/driver.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/hello/driver.cxx b/examples/hello/driver.cxx
index c9d87a3..2c84505 100644
--- a/examples/hello/driver.cxx
+++ b/examples/hello/driver.cxx
@@ -10,11 +10,11 @@
using namespace std;
void
-usage ()
+usage (ostream& os)
{
- cerr << "usage: driver [options] <names>" << endl
- << "options:" << endl;
- options::print_usage (cerr);
+ os << "usage: driver [options] <names>" << endl
+ << "options:" << endl;
+ options::print_usage (os);
}
int
@@ -27,14 +27,14 @@ main (int argc, char* argv[])
if (o.help ())
{
- usage ();
+ usage (cout);
return 0;
}
if (end == argc)
{
cerr << "no names provided" << endl;
- usage ();
+ usage (cerr);
return 1;
}
@@ -53,7 +53,7 @@ main (int argc, char* argv[])
catch (const cli::exception& e)
{
cerr << e << endl;
- usage ();
+ usage (cerr);
return 1;
}
}