14 parser.
registerFileType({
"di1",
"di2",
"dmk",
"dsk",
"xsa",
"fd1",
"fd2"}, *
this);
19 std::string filename =
getArgument(option, cmdLine);
24 return "Insert the disk image specified in argument";
29 parse(
tmpStrCat(
"disk", driveLetter), filename, cmdLine);
44 std::span<std::string>& cmdLine)
47 throw MSXException(
"No disk drive ",
char(::toupper(drive.
back())),
" present to put image '",
image,
"' in.");
51 cmdLine = cmdLine.subspan(1);
52 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::initializer_list< std::string_view > extensions, CLIFileType &cliFileType)
Interpreter & getInterpreter() const
DiskImageCLI(CommandLineParser &parser)
void parseOption(const std::string &option, std::span< std::string > &cmdLine) override
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)
std::string_view substr(std::string_view utf8, std::string_view::size_type first=0, std::string_view::size_type len=std::string_view::npos)
TemporaryString tmpStrCat(Ts &&... ts)