summaryrefslogtreecommitdiff
path: root/util/nvmutil/lib/usage.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-18 14:04:51 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-18 14:20:06 +0000
commit594cc262f4404feab6ab437dacc010f6d1f6263f (patch)
tree6f3fc0157fbfbf8bb98216703246f888cf59cfbc /util/nvmutil/lib/usage.c
parent4dbb1c9bf3e88612ccaf471d3f6db120d255b33b (diff)
nvmutil: move lib files to lib/
only keep nvmutil.c in main Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/lib/usage.c')
-rw-r--r--util/nvmutil/lib/usage.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/util/nvmutil/lib/usage.c b/util/nvmutil/lib/usage.c
new file mode 100644
index 00000000..e8a3cdf7
--- /dev/null
+++ b/util/nvmutil/lib/usage.c
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (c) 2023 Riku Viitanen <riku.viitanen@protonmail.com>
+ * Copyright (c) 2026 Leah Rowe <leah@libreboot.org>
+ *
+ */
+
+#ifdef __OpenBSD__
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "../include/common.h"
+
+void
+usage(void)
+{
+ const char *util;
+
+ util = getnvmprogname();
+
+ fprintf(stderr,
+ "Modify Intel GbE NVM images e.g. set MAC\n"
+ "USAGE:\n"
+ "\t%s FILE dump\n"
+ "\t%s FILE setmac [MAC]\n"
+ "\t%s FILE swap\n"
+ "\t%s FILE copy 0|1\n"
+ "\t%s FILE cat\n"
+ "\t%s FILE cat16\n"
+ "\t%s FILE cat128\n",
+ util, util, util, util,
+ util, util, util);
+
+ err(EINVAL, "Too few arguments");
+}