2019-05-12 00:02:31 +02:00
|
|
|
/* This file is part of remwharead.
|
|
|
|
* Copyright © 2019 tastytea <tastytea@tastytea.de>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, version 3.
|
|
|
|
*
|
|
|
|
* This program 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef REMWHAREAD_PARSE_OPTIONS_HPP
|
|
|
|
#define REMWHAREAD_PARSE_OPTIONS_HPP
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <array>
|
|
|
|
#include <chrono>
|
2019-05-12 20:19:00 +02:00
|
|
|
#include <cstdint>
|
2019-05-15 22:39:14 +02:00
|
|
|
#include "types.hpp"
|
2019-05-14 22:13:58 +02:00
|
|
|
#include "time.hpp"
|
2019-05-12 00:02:31 +02:00
|
|
|
|
|
|
|
using std::string;
|
|
|
|
using std::vector;
|
|
|
|
using std::array;
|
|
|
|
using std::chrono::system_clock;
|
2019-05-15 22:41:48 +02:00
|
|
|
using time_point = system_clock::time_point;
|
2019-05-12 00:02:31 +02:00
|
|
|
using std::uint8_t;
|
|
|
|
|
|
|
|
typedef struct options
|
|
|
|
{
|
|
|
|
vector<string> tags;
|
2019-05-13 02:33:43 +02:00
|
|
|
export_format format = export_format::undefined;
|
2019-05-12 00:02:31 +02:00
|
|
|
string file;
|
2019-05-16 00:26:48 +02:00
|
|
|
array<time_point, 2> span = { time_point(), system_clock::now() };
|
2019-05-14 22:56:58 +02:00
|
|
|
sort_attribute sort = sort_attribute::both;
|
2019-05-16 08:36:35 +02:00
|
|
|
string uri;
|
2019-05-12 20:19:00 +02:00
|
|
|
uint8_t status_code = 0;
|
|
|
|
|
|
|
|
options();
|
|
|
|
explicit options(const uint8_t &status);
|
2019-05-12 00:02:31 +02:00
|
|
|
} options;
|
|
|
|
|
|
|
|
// Parse command-line options.
|
2019-05-12 20:19:00 +02:00
|
|
|
const options parse_options(const int argc, const char *argv[]);
|
2019-05-12 00:02:31 +02:00
|
|
|
|
|
|
|
#endif // REMWHAREAD_PARSE_OPTIONS_HPP
|