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
11
namespace
yaze::cli
{
12
13
// Process-level options z3ed handles before command dispatch.
14
struct
GlobalOptions
{
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`.
32
absl::StatusOr<GlobalOptions>
ParseGlobalFlags
(
33
absl::Span<const std::string> args);
34
35
}
// namespace yaze::cli
36
37
#endif
// YAZE_CLI_GLOBAL_FLAGS_H_
yaze::cli
Definition
agent_editor.h:28
yaze::cli::ParseGlobalFlags
absl::StatusOr< GlobalOptions > ParseGlobalFlags(absl::Span< const std::string > args)
Definition
global_flags.cc:124
yaze::cli::GlobalOptions
Definition
global_flags.h:14
yaze::cli::GlobalOptions::show_version
bool show_version
Definition
global_flags.h:18
yaze::cli::GlobalOptions::positional
std::vector< std::string > positional
Definition
global_flags.h:16
yaze::cli::GlobalOptions::list_commands
bool list_commands
Definition
global_flags.h:19
yaze::cli::GlobalOptions::help_target
std::optional< std::string > help_target
Definition
global_flags.h:23
yaze::cli::GlobalOptions::export_schemas
bool export_schemas
Definition
global_flags.h:21
yaze::cli::GlobalOptions::self_test
bool self_test
Definition
global_flags.h:20
yaze::cli::GlobalOptions::show_help
bool show_help
Definition
global_flags.h:17
src
cli
global_flags.h
Generated by
1.10.0