Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
args.h
1#ifndef OE_CORE_ARGS_H
2#define OE_CORE_ARGS_H
3
4#include "../common.h"
5#include "../lib/flags.h"
6
7#include <set>
8
9namespace oe::core
10{
16 struct Args : public flags::args
17 {
18 using args::args;
19
23 std::vector<std::string> getAllOptions()
24 {
25 auto& options = parser_.options_;
26
27 std::vector<std::string> result(options.size());
28
29 transform(options.begin(), options.end(), result.begin(), [](auto pair){return pair.first;});
30
31 return result;
32 }
33
41 std::vector<std::string> getUnusedOptions(std::span<const std::string> available_arguments)
42 {
43 std::vector<std::string> result;
44
45 auto& options = parser_.options_;
46
47 for (auto& it : options)
48 {
49 if (std::find(available_arguments.begin(), available_arguments.end(), it.first) == available_arguments.end())
50 {
51 result.push_back({it.first.data(), it.first.size()});
52 }
53 }
54
55 return result;
56 }
57 };
58}
59
60#endif
Core functionality (windows, event handler, logger, ...)
Definition args.h:10
command line argument parser
Definition args.h:17
std::vector< std::string > getUnusedOptions(std::span< const std::string > available_arguments)
Fetch a list of unused arguments.
Definition args.h:41
std::vector< std::string > getAllOptions()
Get all options sent to the CLI.
Definition args.h:23