Example #1
0
int main(int argc, char ** argv)
{
    QApplication app(argc, argv);

    Arguments args;
    try
    {
        args.parse(app.arguments());
    } catch(BadArgsException & e)
    {
        fatal(e.toString(), true);
    }

    if (args.hasHelpOption())
    {
        if (! args.getSource().isNull() ||
            ! args.getDestination().isNull() ||
            ! args.getFilters().isEmpty())
        {
            qDebug() << "Option --help pointed,"
                " all others are ignored.";
        }

        helpWrite();
        return 0;
    }

    if (! args.getSource().isNull() &&
        ! args.getDestination().isNull())
    {
        return runCli(args);
    }
    else 
    {
        return runGui(args);
    }
}