2
* Copyright (c) 2002 Robert Collins.
3
* Copyright (c) 2003 Robert Collins.
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* A copy of the GNU General Public License can be found at
13
* Written by Robert Collins <robertc@hotmail.com>
17
#include "getopt++/GetOption.h"
18
#include "getopt++/BoolOption.h"
22
static BoolOption testoption (false, 't', "testoption", "Tests the use of boolean options");
24
main (int anargc, char **anargv)
28
argv[0] = strdup("BoolOptionTest");
29
argv[1] = strdup("-h");
31
BoolOption helpoption (false, 'h', "help", "Tests the use of help output.");
32
if (!GetOption::GetInstance().Process (argc, argv, NULL))
34
std::cout << "Failed to process options" << std::endl;
39
std::cout << "Did not recieve expected help option" << std::endl;
46
BoolOption helpoption (false, 'h', "help", "Tests the use of help output.");
47
if (!GetOption::GetInstance().Process (argc, argv, NULL))
49
std::cout << "Failed to process options (2) " << std::endl;
54
std::cout << "Recieved unexpected help option" << std::endl;