From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 4/8] client: add developer mode option (-E)
Date: Wed, 10 Aug 2022 16:16:17 -0700 [thread overview]
Message-ID: <20220810231621.372514-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20220810231621.372514-1-prestwoj@gmail.com>
This puts iwctl into developer mode which allows IWD debug interfaces
to be used.
---
client/command.c | 26 ++++++++++++++++++--------
client/command.h | 1 +
2 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/client/command.c b/client/command.c
index c0576e97..80599620 100644
--- a/client/command.c
+++ b/client/command.c
@@ -38,6 +38,7 @@ static struct l_queue *command_families;
static struct l_queue *command_options;
static int exit_status;
static bool interactive_mode;
+static bool developer_mode;
static struct command_noninteractive {
char **argv;
int argc;
@@ -616,6 +617,11 @@ bool command_is_interactive_mode(void)
return interactive_mode;
}
+bool command_is_developer_mode(void)
+{
+ return developer_mode;
+}
+
void command_set_exit_status(int status)
{
exit_status = status;
@@ -657,6 +663,7 @@ static const struct option command_opts[] = {
{ COMMAND_OPTION_PASSPHRASE, required_argument, NULL, 'P' },
{ COMMAND_OPTION_DONTASK, no_argument, NULL, 'd' },
{ "help", no_argument, NULL, 'h' },
+ { "developer", no_argument, NULL, 'E' },
{ }
};
@@ -671,17 +678,10 @@ bool command_init(char **argv, int argc)
command_families = l_queue_new();
command_options = l_queue_new();
- for (desc = __start___command; desc < __stop___command; desc++) {
- if (!desc->init)
- continue;
-
- desc->init();
- }
-
for (;;) {
struct command_option *option;
- opt = getopt_long(argc, argv, "u:p:P:dh", command_opts, NULL);
+ opt = getopt_long(argc, argv, "u:p:P:dhE", command_opts, NULL);
switch (opt) {
case 'u':
@@ -714,6 +714,9 @@ bool command_init(char **argv, int argc)
l_queue_push_tail(command_options, option);
+ break;
+ case 'E':
+ developer_mode = true;
break;
case 'h':
command_display_help();
@@ -731,6 +734,13 @@ bool command_init(char **argv, int argc)
}
options_parsed:
+ for (desc = __start___command; desc < __stop___command; desc++) {
+ if (!desc->init)
+ continue;
+
+ desc->init();
+ }
+
argv += optind;
argc -= optind;
diff --git a/client/command.h b/client/command.h
index 23f23dc9..bdfc7e99 100644
--- a/client/command.h
+++ b/client/command.h
@@ -69,6 +69,7 @@ void command_process_prompt(char **argv, int argc);
void command_noninteractive_trigger(void);
bool command_is_interactive_mode(void);
+bool command_is_developer_mode(void);
int command_get_exit_status(void);
void command_set_exit_status(int status);
void command_reset_default_entities(void);
--
2.34.3
next prev parent reply other threads:[~2022-08-10 23:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-10 23:16 [PATCH 1/8] network: make network const in network_bss_list_get_entries James Prestwood
2022-08-10 23:16 ` [PATCH 2/8] station: check for matching SSID in Roam() James Prestwood
2022-08-10 23:16 ` [PATCH 3/8] station: add debug method GetNetworks James Prestwood
2022-08-11 14:39 ` Denis Kenzior
2022-08-10 23:16 ` James Prestwood [this message]
2022-08-11 14:40 ` [PATCH 4/8] client: add developer mode option (-E) Denis Kenzior
2022-08-10 23:16 ` [PATCH 5/8] client: allow entity name to be passed to completion James Prestwood
2022-08-10 23:16 ` [PATCH 6/8] client: add STATION_DEBUG_INTERFACE definition James Prestwood
2022-08-11 14:46 ` Denis Kenzior
2022-08-10 23:16 ` [PATCH 7/8] client: add station-debug command interface James Prestwood
2022-08-10 23:16 ` [PATCH 8/8] client: fix station autocomplete with multiple phys James Prestwood
2022-08-11 14:48 ` Denis Kenzior
2022-08-11 14:39 ` [PATCH 1/8] network: make network const in network_bss_list_get_entries Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220810231621.372514-4-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.