Factor out common usage-help code

This commit is contained in:
Rangi42
2025-07-27 19:20:04 -04:00
parent 16e16cdf51
commit b2747dfbd8
9 changed files with 138 additions and 179 deletions

View File

@@ -1,7 +1,5 @@
// SPDX-License-Identifier: MIT
// platform-specific hacks
#ifndef RGBDS_PLATFORM_HPP
#define RGBDS_PLATFORM_HPP

21
include/usage.hpp Normal file
View File

@@ -0,0 +1,21 @@
// SPDX-License-Identifier: MIT
#ifndef RGBDS_USAGE_HPP
#define RGBDS_USAGE_HPP
#include <stdarg.h>
class Usage {
char const *usage;
public:
Usage(char const *usage_) : usage(usage_) {}
[[noreturn]]
void printAndExit(int code) const;
[[gnu::format(printf, 2, 3), noreturn]]
void printAndExit(char const *fmt, ...) const;
};
#endif // RGBDS_USAGE_HPP