1
0
mirror of https://github.com/ScrelliCopter/tmx2gba.git synced 2025-02-21 03:29:25 +11:00

argparse: use replace raw char* strings with string views

This commit is contained in:
2024-04-08 02:22:23 +10:00
parent d69eec8dcf
commit f9928df187
3 changed files with 12 additions and 11 deletions

View File

@@ -16,16 +16,16 @@ namespace ArgParse
{
struct Option
{
const char* argumentName;
const char* helpString;
std::string_view argumentName;
std::string_view helpString;
char flag;
bool required;
static constexpr Option Optional(char flag, const char* name, const char* help)
static constexpr Option Optional(char flag, const std::string_view name, const std::string_view help)
{
return { name, help, flag, false };
}
static constexpr Option Required(char flag, const char* name, const char* help)
static constexpr Option Required(char flag, const std::string_view name, const std::string_view help)
{
return { name, help, flag, true };
}