main.cpp
author Markus Bröker <mbroeker@largo.homelinux.org>
Sat, 13 Dec 2008 15:47:44 +0100
changeset 1 9de88b525a59
parent 0 826dd5531eb0
child 4 fdf04a93faeb
permissions -rw-r--r--
missing ui files added

/*
 *  $Id: main.cpp 54 2008-01-10 00:24:52Z mbroeker $
 * $URL: http://localhost/svn/cpp/qMonitor/trunk/main.cpp $
 */

#include <QApplication>

#include "include/monitor.h"
#include <version.h>

int main (int argc, char *argv[])
{
    int i;

    while ((i = getopt (argc, argv, "hv")) >= 0) {
        switch (i) {
        case 'h':
            std::cout << "Usage: " << argv[0] << " [OPTIONS]" << std::endl;
            std::cout << "qMonitor displays the online traffic." << std::endl << std::endl;
            std::cout << "Options:" << std::endl << std::endl;
            std::cout << "-h: \t\t\tShow this help" << std::endl;
            std::cout << "-v: \t\t\tShow Version" << std::endl;

            exit (0);
            break;
        case 'v':
            std::cout << VERSION_STRING << std::endl;
            exit (0);
            break;

        default:
            ;
        }
    }

    QApplication app (argc, argv);
    Monitor *dialog = new Monitor;

    dialog->show ();
    return app.exec ();
}