mirror of
https://github.com/apognu/tuigreet.git
synced 2024-09-11 07:25:29 +03:00
Issue #124/PR #125: sort alphabetically by default
This commit is contained in:
parent
c658c77f96
commit
c186f0b8c8
@ -33,8 +33,6 @@ Options:
|
||||
remember last selected session
|
||||
--remember-user-session
|
||||
remember last selected session for each user
|
||||
--sort-sessions
|
||||
sort sessions alphabetically
|
||||
--user-menu allow graphical selection of users from a menu
|
||||
--user-menu-min-uid UID
|
||||
minimum UID to display in the user selection menu
|
||||
|
@ -141,8 +141,6 @@ pub struct Greeter {
|
||||
pub remember_session: bool,
|
||||
// Whether last launched session for the current user should be remembered.
|
||||
pub remember_user_session: bool,
|
||||
// Whether to sort sessions alphabetically.
|
||||
pub sort_sessions: bool,
|
||||
|
||||
// Greeting message (MOTD) to use to welcome the user.
|
||||
pub greeting: Option<String>,
|
||||
@ -369,7 +367,6 @@ impl Greeter {
|
||||
opts.optflag("r", "remember", "remember last logged-in username");
|
||||
opts.optflag("", "remember-session", "remember last selected session");
|
||||
opts.optflag("", "remember-user-session", "remember last selected session for each user");
|
||||
opts.optflag("", "sort-sessions", "sort sessions alphabetically");
|
||||
opts.optflag("", "user-menu", "allow graphical selection of users from a menu");
|
||||
opts.optopt("", "user-menu-min-uid", "minimum UID to display in the user selection menu", "UID");
|
||||
opts.optopt("", "user-menu-max-uid", "maximum UID to display in the user selection menu", "UID");
|
||||
@ -483,7 +480,6 @@ impl Greeter {
|
||||
self.remember = self.config().opt_present("remember");
|
||||
self.remember_session = self.config().opt_present("remember-session");
|
||||
self.remember_user_session = self.config().opt_present("remember-user-session");
|
||||
self.sort_sessions = self.config().opt_present("sort-sessions");
|
||||
self.greeting = self.option("greeting");
|
||||
|
||||
// If the `--cmd` argument is provided, it will override the selected session.
|
||||
|
@ -227,9 +227,7 @@ pub fn get_sessions(greeter: &Greeter) -> Result<Vec<Session>, Box<dyn Error>> {
|
||||
}
|
||||
}
|
||||
|
||||
if greeter.sort_sessions {
|
||||
files.sort_by(|a, b| a.name.cmp(&b.name));
|
||||
}
|
||||
files.sort_by(|a, b| a.name.cmp(&b.name));
|
||||
|
||||
Ok(files)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user