diff mbox series

[3/3] client: fix non-interactive mode in some cases

Message ID 20221120160912.72307-3-env252525@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/3] gitignore: add compile_commands.json | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

Neehar Vijay Nov. 20, 2022, 4:09 p.m. UTC
Before this change, I noticed that some non-interactive commands
don't work,

  $ iwctl version

  $ iwctl help

while other ones do.

  $ iwctl station wlan0 show

This seems to be a typo bug in the if clause checking for additional
arguments.
---
 client/command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/client/command.c b/client/command.c
index dbd97703..84be680c 100644
--- a/client/command.c
+++ b/client/command.c
@@ -753,7 +753,7 @@  options_parsed:
 	argv += optind;
 	argc -= optind;
 
-	if (argc < 2) {
+	if (argc < 1) {
 		interactive_mode = true;
 		return false;
 	}