From 866087211fddd5b468841fa29b17b65dbd582b7c Mon Sep 17 00:00:00 2001 From: Riku Viitanen Date: Mon, 6 Nov 2023 13:00:05 +0200 Subject: nvmutil: print usage Signed-off-by: Riku Viitanen --- util/nvmutil/nvmutil.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 0ccfaf32..35abbfae 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: MIT */ /* SPDX-FileCopyrightText: 2022, 2023 Leah Rowe */ +/* SPDX-FileCopyrightText: 2023 Riku Viitanen */ #include @@ -61,8 +62,16 @@ void (*cmd)(void) = NULL; int main(int argc, char *argv[]) { - if (argc < 3) + if (argc < 3) { + fprintf(stderr, "USAGE:\n"); + fprintf(stderr, " %s FILE dump\n", argv[0]); + fprintf(stderr, " %s FILE setmac [MAC]\n", argv[0]); + fprintf(stderr, " %s FILE swap\n", argv[0]); + fprintf(stderr, " %s FILE copy 0|1\n", argv[0]); + fprintf(stderr, " %s FILE brick 0|1\n", argv[0]); + fprintf(stderr, " %s FILE setchecksum 0|1\n", argv[0]); err(errno = ECANCELED, "Too few arguments"); + } flags = (strcmp(COMMAND, "dump") == 0) ? O_RDONLY : flags; filename = argv[1]; #ifdef __OpenBSD__ -- cgit v1.2.1