Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing a username directly #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GaetanLepage
Copy link

Hello !
This is a proposal to add a new option --user (or --default-user) which would make possible to call tuigreet with a username to be pre-filled.
Of course, someone could already user the --remember but it could be useful to be able to 'hardcode' directly the desired username in the CLI arguments.

Note: I have almost 0 knowledge in Rust. The provided code has to be taken with care !

@teto
Copy link

teto commented Oct 16, 2024

I like the idea as well

@apognu
Copy link
Owner

apognu commented Oct 16, 2024

I'm not against adding that in 0.11 (so not the next version, which I would like to be feature-freezed until release). 0.11 will also include a way to configure tuigreet through a configuration file, so this will fit nicely.

Before I look at the code, let's talk about the functional side. How will this cohabit with the remember feature? Because the way I see it, if remember is enabled, the first time you log in with the default user, it will be cached, which will make changing the default user a no-op. On the other hand, whenever another user logs in, the default will be ignored.

Should we forbid using both options at the same time to prevent confusion?

Also (but it can wait until we agree on the point above), the README and the manpage will need to be updated to include the new option, and a test will need to be written / edited to include this option.

Edit: I just saw this is... one year old. Apologies for not seeing it before. I must have missed the notification.

@GaetanLepage
Copy link
Author

I'm not against adding that in 0.11 (so not the next version, which I would like to be feature-freezed until release). 0.11 will also include a way to configure tuigreet through a configuration file, so this will fit nicely.

Makes sense ! A config file is a great idea.

Before I look at the code, let's talk about the functional side. How will this cohabit with the remember feature? Because the way I see it, if remember is enabled, the first time you log in with the default user, it will be cached, which will make changing the default user a no-op. On the other hand, whenever another user logs in, the default will be ignored.

Should we forbid using both options at the same time to prevent confusion?

I would say that we either prevent both options to be simultaneously provided or we (silently or not) make the --username take precedence over --remember.

Also (but it can wait until we agree on the point above), the README and the manpage will need to be updated to include the new option, and a test will need to be written / edited to include this option.

Sure, I will do so after we agree on the spec.

Edit: I just saw this is... one year old. Apologies for not seeing it before. I must have missed the notification.

Don't worry ! I had forgotten about it too. Thanks for taking the time to look at it in the end anyway :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants