yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
global_flags.h
Go to the documentation of this file.
1#ifndef YAZE_CLI_GLOBAL_FLAGS_H_
2#define YAZE_CLI_GLOBAL_FLAGS_H_
3
4#include <optional>
5#include <string>
6#include <vector>
7
8#include "absl/status/statusor.h"
9#include "absl/types/span.h"
10
11namespace yaze::cli {
12
13// Process-level options z3ed handles before command dispatch.
15 // The command name followed by its arguments, with global flags removed.
16 std::vector<std::string> positional;
17 bool show_help = false;
18 bool show_version = false;
19 bool list_commands = false;
20 bool self_test = false;
21 bool export_schemas = false;
22 // Set by `--help=<target>` or `--help <target>`.
23 std::optional<std::string> help_target;
24};
25
26// Parses the z3ed command line, excluding the program name.
27//
28// Global flags such as --rom and --ai-provider may appear anywhere before
29// "--" and are written to their absl flags; dash and underscore spellings are
30// equivalent. Every other token, and everything after "--", is forwarded to
31// the command in `positional`.
32absl::StatusOr<GlobalOptions> ParseGlobalFlags(
33 absl::Span<const std::string> args);
34
35} // namespace yaze::cli
36
37#endif // YAZE_CLI_GLOBAL_FLAGS_H_
absl::StatusOr< GlobalOptions > ParseGlobalFlags(absl::Span< const std::string > args)
std::vector< std::string > positional
std::optional< std::string > help_target