12 static constexpr std::array<std::string_view, 7> extensions = {
13 "di1",
"di2",
"dmk",
"dsk",
"xsa",
"fd1",
"fd2"
21 for (
const auto* disk : {
"-diska",
"-diskb"}) {
29 std::string filename =
getArgument(option, cmdLine);
30 parse(
zstring_view(option).substr(1), filename, cmdLine);
34 return "Insert the disk image specified in argument";
39 parse(
tmpStrCat(
"disk", driveLetter), filename, cmdLine);
54 std::span<std::string>& cmdLine)
const
57 throw MSXException(
"No disk drive ",
char(::toupper(drive.
back())),
" present to put image '",
image,
"' in.");
61 cmdLine = cmdLine.subspan(1);
62 command.addListElement(
getArgument(
"-ips", cmdLine));
static std::string getArgument(const std::string &option, std::span< std::string > &cmdLine)
static std::string peekArgument(const std::span< std::string > &cmdLine)
void registerOption(const char *str, CLIOption &cliOption, ParsePhase phase=PHASE_LAST, unsigned length=2)
void registerFileType(std::span< const std::string_view > extensions, CLIFileType &cliFileType)
Interpreter & getInterpreter() const
DiskImageCLI(CommandLineParser &parser)
void parseOption(const std::string &option, std::span< std::string > &cmdLine) override
static std::span< const std::string_view > getExtensions()
void parseFileType(const std::string &filename, std::span< std::string > &cmdLine) override
std::string_view fileTypeHelp() const override
std::string_view fileTypeCategoryName() const override
std::string_view optionHelp() const override
bool hasCommand(zstring_view name) const
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
constexpr char back() const
This file implemented 3 utility functions:
TclObject makeTclList(Args &&... args)
TemporaryString tmpStrCat(Ts &&... ts)