From f54118cd68329e1482c59734b665e6e66852b60a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 1 Apr 2019 19:04:13 +0200 Subject: [login] Add "--nouser" option to just ask for password --- src/hci/commands/login_cmd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/hci/commands') diff --git a/src/hci/commands/login_cmd.c b/src/hci/commands/login_cmd.c index c9e196437..6ed76c6f2 100644 --- a/src/hci/commands/login_cmd.c +++ b/src/hci/commands/login_cmd.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -36,10 +37,16 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); */ /** "login" options */ -struct login_options {}; +struct login_options { + /** No Username */ + int nouser; +}; /** "login" option list */ -static struct option_descriptor login_opts[] = {}; +static struct option_descriptor login_opts[] = { + OPTION_DESC ( "nouser", 'n', no_argument, + struct login_options, nouser, parse_flag ), +}; /** "login" command descriptor */ static struct command_descriptor login_cmd = @@ -61,7 +68,7 @@ static int login_exec ( int argc, char **argv ) { return rc; /* Show login UI */ - if ( ( rc = login_ui() ) != 0 ) { + if ( ( rc = login_ui( opts.nouser ) ) != 0 ) { printf ( "Could not set credentials: %s\n", strerror ( rc ) ); return rc; -- cgit v1.2.3-55-g7522