mirror of
				https://git.kernel.org/pub/scm/network/wireless/iwd.git
				synced 2025-11-04 08:57:29 +01:00 
			
		
		
		
	client: Add '--dontask' command-line option
This option prevents iwctl from prompting user for the secrets if they were not provided as the command-line arguments.
This commit is contained in:
		
							parent
							
								
									0a1cd37228
								
							
						
					
					
						commit
						62d286a745
					
				@ -624,6 +624,7 @@ static const struct option command_opts[] = {
 | 
			
		||||
	{ COMMAND_OPTION_USERNAME,	required_argument, NULL, 'u' },
 | 
			
		||||
	{ COMMAND_OPTION_PASSWORD,	required_argument, NULL, 'p' },
 | 
			
		||||
	{ COMMAND_OPTION_PASSPHRASE,	required_argument, NULL, 'P' },
 | 
			
		||||
	{ COMMAND_OPTION_DONTASK,	no_argument,	   NULL, 'd' },
 | 
			
		||||
	{ }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@ -648,7 +649,7 @@ bool command_init(char **argv, int argc)
 | 
			
		||||
	for (;;) {
 | 
			
		||||
		struct command_option *option;
 | 
			
		||||
 | 
			
		||||
		opt = getopt_long(argc, argv, "u:p:P:", command_opts, NULL);
 | 
			
		||||
		opt = getopt_long(argc, argv, "u:p:P:d", command_opts, NULL);
 | 
			
		||||
 | 
			
		||||
		switch (opt) {
 | 
			
		||||
		case 'u':
 | 
			
		||||
@ -674,6 +675,13 @@ bool command_init(char **argv, int argc)
 | 
			
		||||
 | 
			
		||||
			l_queue_push_tail(command_options, option);
 | 
			
		||||
 | 
			
		||||
			break;
 | 
			
		||||
		case 'd':
 | 
			
		||||
			option = l_new(struct command_option, 1);
 | 
			
		||||
			option->name = COMMAND_OPTION_DONTASK;
 | 
			
		||||
 | 
			
		||||
			l_queue_push_tail(command_options, option);
 | 
			
		||||
 | 
			
		||||
			break;
 | 
			
		||||
		case -1:
 | 
			
		||||
			goto options_parsed;
 | 
			
		||||
 | 
			
		||||
@ -23,6 +23,7 @@
 | 
			
		||||
#define COMMAND_OPTION_USERNAME		"username"
 | 
			
		||||
#define COMMAND_OPTION_PASSWORD		"password"
 | 
			
		||||
#define COMMAND_OPTION_PASSPHRASE	"passphrase"
 | 
			
		||||
#define COMMAND_OPTION_DONTASK		"dontask"
 | 
			
		||||
 | 
			
		||||
typedef char *(*command_completion_func_t) (const char *text, int state);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user