Skip to content

Prompt user again on invalid selection#255

Merged
edthedev merged 4 commits intotechservicesillinois:masterfrom
ddriddle:issue/94
Dec 18, 2025
Merged

Prompt user again on invalid selection#255
edthedev merged 4 commits intotechservicesillinois:masterfrom
ddriddle:issue/94

Conversation

@ddriddle
Copy link
Collaborator

@ddriddle ddriddle commented Aug 19, 2025

Example of the user exiting:

$ aws login
Please choose the role you would like to assume:
     Account: 199050005105
         [ 0 ]: Admins
     Account: 378517677616
         [ 1 ]: TechServicesStaff
     Account: 510155251718
         [ 2 ]: PIE-SharedWP-Team
     Account: 736533337653
         [ 3 ]: ADAdmins
Select a role or enter 'q' to quit: q
No role selected. Good bye!
$

Example of the user making a typo then successfully selecting a role:

$ aws login
Please choose the role you would like to assume:
     Account: 199050005105
         [ 0 ]: Admins
     Account: 378517677616
         [ 1 ]: TechServicesStaff
     Account: 510155251718
         [ 2 ]: PIE-SharedWP-Team
     Account: 736533337653
         [ 3 ]: ADAdmins
Select a role or enter 'q' to quit: foo
Invalid value. Try again.
Please choose the role you would like to assume:
     Account: 199050005105
         [ 0 ]: Admins
     Account: 378517677616
         [ 1 ]: TechServicesStaff
     Account: 510155251718
         [ 2 ]: PIE-SharedWP-Team
     Account: 736533337653
         [ 3 ]: ADAdmins
Select a role or enter 'q' to quit: 0
$

Example of the program failing out after three failures in a row:

$ aws login
Please choose the role you would like to assume:
     Account: 199050005105
         [ 0 ]: Admins
     Account: 378517677616
         [ 1 ]: TechServicesStaff
     Account: 510155251718
         [ 2 ]: PIE-SharedWP-Team
     Account: 736533337653
         [ 3 ]: ADAdmins
Select a role or enter 'q' to quit: 
Invalid value. Try again.
Please choose the role you would like to assume:
     Account: 199050005105
         [ 0 ]: Admins
     Account: 378517677616
         [ 1 ]: TechServicesStaff
     Account: 510155251718
         [ 2 ]: PIE-SharedWP-Team
     Account: 736533337653
         [ 3 ]: ADAdmins
Select a role or enter 'q' to quit: 
Invalid value. Try again.
Please choose the role you would like to assume:
     Account: 199050005105
         [ 0 ]: Admins
     Account: 378517677616
         [ 1 ]: TechServicesStaff
     Account: 510155251718
         [ 2 ]: PIE-SharedWP-Team
     Account: 736533337653
         [ 3 ]: ADAdmins
Select a role or enter 'q' to quit: 
Invalid value. Try again.
Too many invalid selections!
$

Closes #94

@ddriddle ddriddle requested a review from JonRoma August 19, 2025 16:22
@ddriddle ddriddle self-assigned this Aug 20, 2025
@ddriddle ddriddle added enhancement New feature or request usability Improves product usability requested Requested by user community labels Aug 20, 2025
@ddriddle ddriddle marked this pull request as ready for review August 20, 2025 16:17
@edthedev edthedev merged commit 5ba2ac2 into techservicesillinois:master Dec 18, 2025
47 checks passed
@edthedev edthedev deleted the issue/94 branch December 18, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request requested Requested by user community usability Improves product usability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

invalid literal for int() with base 10: '' when omitting role selection

3 participants