54 void parse(std::span<char*> argv);
58 return scriptOption.scripts;
61 return commandOption.commands;
71 : name(n), option(o), phase(p), length(l) {}
73 std::string_view name;
79 std::string_view extension;
80 CLIFileType* fileType;
83 [[nodiscard]]
bool parseFileName(
const std::string& arg,
84 std::span<std::string>& cmdLine);
85 [[nodiscard]] CLIFileType* getFileTypeHandlerForFileName(std::string_view filename)
const;
86 [[nodiscard]]
bool parseOption(
const std::string& arg,
87 std::span<std::string>& cmdLine,
ParsePhase phase);
88 void createMachineSetting();
91 std::vector<OptionData> options;
92 std::vector<FileTypeData> fileTypes;
96 struct HelpOption final : CLIOption {
97 void parseOption(
const std::string& option, std::span<std::string>& cmdLine)
override;
98 [[nodiscard]] std::string_view optionHelp()
const override;
101 struct VersionOption final : CLIOption {
102 void parseOption(
const std::string& option, std::span<std::string>& cmdLine)
override;
103 [[nodiscard]] std::string_view optionHelp()
const override;
106 struct ControlOption final : CLIOption {
107 void parseOption(
const std::string& option, std::span<std::string>& cmdLine)
override;
108 [[nodiscard]] std::string_view optionHelp()
const override;
111 struct ScriptOption final : CLIOption, CLIFileType {
112 void parseOption(
const std::string& option, std::span<std::string>& cmdLine)
override;
113 [[nodiscard]] std::string_view optionHelp()
const override;
114 void parseFileType(
const std::string& filename,
115 std::span<std::string>& cmdLine)
override;
116 [[nodiscard]] std::string_view fileTypeCategoryName()
const override;
117 [[nodiscard]] std::string_view fileTypeHelp()
const override;
119 std::vector<std::string> scripts;
122 struct CommandOption final : CLIOption {
123 void parseOption(
const std::string& option, std::span<std::string>& cmdLine)
override;
124 [[nodiscard]] std::string_view optionHelp()
const override;
126 std::vector<std::string> commands;
129 struct MachineOption final : CLIOption {
130 void parseOption(
const std::string& option, std::span<std::string>& cmdLine)
override;
131 [[nodiscard]] std::string_view optionHelp()
const override;
134 struct SettingOption final : CLIOption {
135 void parseOption(
const std::string& option, std::span<std::string>& cmdLine)
override;
136 [[nodiscard]] std::string_view optionHelp()
const override;
139 struct TestConfigOption final : CLIOption {
140 void parseOption(
const std::string& option, std::span<std::string>& cmdLine)
override;
141 [[nodiscard]] std::string_view optionHelp()
const override;
144 struct BashOption final : CLIOption {
145 void parseOption(
const std::string& option, std::span<std::string>& cmdLine)
override;
146 [[nodiscard]] std::string_view optionHelp()
const override;
149 struct FileTypeCategoryInfoTopic final : InfoTopic {
150 FileTypeCategoryInfoTopic(InfoCommand& openMSXInfoCommand,
const CommandLineParser& parser);
151 void execute(std::span<const TclObject> tokens, TclObject& result)
const override;
152 [[nodiscard]] std::string help(std::span<const TclObject> tokens)
const override;
154 const CommandLineParser& parser;
156 std::optional<FileTypeCategoryInfoTopic> fileTypeCategoryInfo;
159 CliExtension cliExtension;
161 SaveStateCLI saveStateCLI;
162 CassettePlayerCLI cassettePlayerCLI;
163#if COMPONENT_LASERDISC
164 LaserdiscPlayerCLI laserdiscPlayerCLI;
166 DiskImageCLI diskImageCLI;
167 HDImageCLI hdImageCLI;
168 CDImageCLI cdImageCLI;
170 bool haveConfig =
false;
171 bool haveSettings =
false;