aboutsummaryrefslogtreecommitdiffstats
path: root/nihil/usage_error.ccm
diff options
context:
space:
mode:
Diffstat (limited to 'nihil/usage_error.ccm')
-rw-r--r--nihil/usage_error.ccm28
1 files changed, 28 insertions, 0 deletions
diff --git a/nihil/usage_error.ccm b/nihil/usage_error.ccm
new file mode 100644
index 0000000..9b56991
--- /dev/null
+++ b/nihil/usage_error.ccm
@@ -0,0 +1,28 @@
+/*
+ * This source code is released into the public domain.
+ */
+
+module;
+
+#include <format>
+#include <utility>
+
+export module nihil:usage_error;
+
+import :generic_error;
+
+namespace nihil {
+
+/*
+ * Exception thrown to indicate invalid command-line arguments.
+ */
+export struct usage_error : generic_error {
+ template<typename... Args>
+ usage_error(std::format_string<Args...> fmt, Args &&...args)
+ : generic_error(fmt, std::forward<Args>(args)...)
+ {}
+};
+
+} // namespace nihil
+
+