main.cpp
author Markus Bröker <mbroeker@largo.homelinux.org>
Sat, 03 Jan 2009 01:28:28 +0100
changeset 4 fdf04a93faeb
parent 0 826dd5531eb0
permissions -rw-r--r--
Codebase indented by me and gnu-indent

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

#include <QApplication>
#include <cstdlib>

#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 ();
}