<commit_before>/****************************************************************************
**
** Copyright (C) 2012 - 2013 Jolla Ltd.
** Contact: http://jolla.com/
**
** This file is part of Qt Creator.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Digia.
**
****************************************************************************/

#include "generatekeyscommand.h"
#include <ssh/sshkeygenerator.h>
#include <QFile>

GenerateKeysCommand::GenerateKeysCommand()
{
}

QString GenerateKeysCommand::name() const
{
    return QLatin1String("merssh");
}

bool GenerateKeysCommand::parseArguments()
{
    const QStringList &args = arguments();

    for (int i = 0; i < args.count(); ++i) {
        const QString current = args.at(i);
        const QString next = ((i + 1) < args.count()) ? args.at(i + 1) : QString();

        if (m_privateKeyFileName.isNull()) {
            m_privateKeyFileName = current;
            continue;
        }

        if (m_publicKeyFileName.isNull()) {
            m_publicKeyFileName = current;
            continue;
        }

        if (next.isNull())
            return false;
    }

    if (m_privateKeyFileName.isEmpty())
        qCritical() << "No private kit given.";
    if (m_publicKeyFileName.isEmpty())
        qCritical() << "No piblic key given.";<commit_msg>Jolla: Fix args parsing for generatesshkeys<commit_after>/****************************************************************************
**
** Copyright (C) 2012 - 2013 Jolla Ltd.
** Contact: http://jolla.com/
**
** This file is part of Qt Creator.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Digia.
**
****************************************************************************/

#include "generatekeyscommand.h"
#include <ssh/sshkeygenerator.h>
#include <QFile>

GenerateKeysCommand::GenerateKeysCommand()
{
}

QString GenerateKeysCommand::name() const
{
    return QLatin1String("merssh");
}

bool GenerateKeysCommand::parseArguments()
{
    const QStringList &args = arguments();

    for (int i = 1; i < args.count(); ++i) {
        const QString current = args.at(i);
        const QString next = ((i + 1) < args.count()) ? args.at(i + 1) : QString();

        if (m_privateKeyFileName.isNull()) {
            m_privateKeyFileName = current;
            continue;
        }

        if (m_publicKeyFileName.isNull()) {
            m_publicKeyFileName = current;
            continue;
        }

        if (next.isNull())
            return false;
    }

    if (m_privateKeyFileName.isEmpty())
        qCritical() << "No private kit given.";
    if (m_publicKeyFileName.isEmpty())
        qCritical() << "No piblic key given.";
{'fraction_non_alphanumeric': 0.1856396866840731, 'fraction_numerical': 0.009399477806788513, 'mean_word_length': 3.5070588235294116, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5537463', 'n_tokens_mistral': 1058, 'n_tokens_neox': 977, 'n_words': 346}