summaryrefslogtreecommitdiff
path: root/c_src/cmd_format.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-08-18 14:00:27 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-08-18 14:00:27 -0400
commitcd01dec844837f929ff04e9e568b78cea2678932 (patch)
treefe50dd2ffb227bae2b51b2d646fad879b552e6de /c_src/cmd_format.c
parent45b2f382db4febb1db738785f870424aee22f01c (diff)
Commands called with no arguments now print usage
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'c_src/cmd_format.c')
-rw-r--r--c_src/cmd_format.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/c_src/cmd_format.c b/c_src/cmd_format.c
index dfd54259..873c1a69 100644
--- a/c_src/cmd_format.c
+++ b/c_src/cmd_format.c
@@ -249,8 +249,10 @@ int cmd_format(int argc, char *argv[])
if (unconsumed_dev_option)
die("Options for devices apply to subsequent devices; got a device option with no device");
- if (!devices.nr)
+ if (!devices.nr) {
+ format_usage();
die("Please supply a device");
+ }
if (opts.source && !initialize)
die("--source, --no_initialize are incompatible");