From 5e98e0c86367ccc3abb03913f7526aaafaf62d83 Mon Sep 17 00:00:00 2001 From: mes5k Date: Wed, 5 Jan 2005 18:28:09 +0000 Subject: [PATCH] fixed output override bug --- examples/test4.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/test4.cpp b/examples/test4.cpp index 696a83b..eefff99 100644 --- a/examples/test4.cpp +++ b/examples/test4.cpp @@ -16,10 +16,23 @@ class MyOutput : public StdOutput virtual void failure(CmdLineInterface& c, ArgException& e) { - cerr << "My special failure message for: " << endl + cerr << "my failure message: " << endl << e.what() << endl; } + virtual void usage(CmdLineInterface& c) + { + cout << "my usage message:" << endl; + list args = c.getArgList(); + for (ArgListIterator it = args.begin(); it != args.end(); it++) + cout << (*it)->longID() + << " (" << (*it)->getDescription() << ")" << endl; + } + + virtual void version(CmdLineInterface& c) + { + cout << "my version message: 0.1" << endl; + } };