xaizek / uncov (License: AGPLv3+) (since 2018-12-07)
Uncov(er) is a tool that collects and processes code coverage reports.
<root> / src / Uncov.hpp (5e25876e5e3fc9aaebffa26b237744c404bb9ab9) (1,964B) (mode 100644) [raw]
// Copyright (C) 2020 xaizek <xaizek@posteo.net>
//
// This file is part of uncov.
//
// uncov is free software: you can redistribute it and/or modify
// it under the terms of version 3 of the GNU Affero General Public License as
// published by the Free Software Foundation.
//
// uncov is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with uncov.  If not, see <http://www.gnu.org/licenses/>.

#ifndef UNCOV_UNCOV_HPP_
#define UNCOV_UNCOV_HPP_

#include <map>
#include <string>
#include <vector>

#include "Invocation.hpp"

class Settings;
class SubCommand;

/**
 * @brief Class that represents application.
 */
class Uncov
{
public:
    /**
     * @brief Constructs main application class and parses arguments.
     *
     * @param args Arguments of the application.
     *
     * @throws std::invalid_argument on empty argument list.
     */
    explicit Uncov(std::vector<std::string> args);

public:
    /**
     * @brief Entry point of the application.
     *
     * @param settings Configuration.
     *
     * @returns Exit status of the application (to be returned by @c main()).
     */
    int run(Settings &settings);

    /**
     * @brief Prints help on standard output.
     */
    void printHelp();

    /**
     * @brief Prints help for a specific command to standard output.
     *
     * @param alias Alias of the command.
     *
     * @throws std::invalid_argument on unknown command name.
     */
    void printHelp(const std::string &alias);

private:
    /// Processor of command-line arguments.
    Invocation invocation;
    /// List of all commands (sorted due to use of `std::map`).
    std::map<std::string, SubCommand *> cmds;
};

#endif // UNCOV_UNCOV_HPP_
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/uncov

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/uncov

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master