File: versionhelp.cc

package info (click to toggle)
xd 5.00.03-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 708 kB
  • sloc: cpp: 1,852; fortran: 161; makefile: 107; sh: 36; ansic: 30
file content (22 lines) | stat: -rw-r--r-- 785 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "options.ih"

    // by options1.ccc

void Options::versionHelp(char const *version, 
                          void (*usage)(string  const  &)) const
{
    streambuf *buf = cout.rdbuf(cerr.rdbuf());      // make sure that
    try                                             // versionHelp doesn't
    {                                               // write to cout

        d_arg.versionHelp(usage, version, 1);       // need at least 1 arg 
        cout.rdbuf(buf);                            // insert the help
    }
    catch(...)
    {
        cout.rdbuf(buf);                            // missing argument:
        throw;                                      // help is provided and
                                                    // ends the program
    }
    
}