Skip to content

Do not ask which file to restore if there is only one option#369

Open
GideonBear wants to merge 1 commit intoandreafrancia:masterfrom
GideonBear:restore-single-no-ask
Open

Do not ask which file to restore if there is only one option#369
GideonBear wants to merge 1 commit intoandreafrancia:masterfrom
GideonBear:restore-single-no-ask

Conversation

@GideonBear
Copy link

Ref #175, #359

When a path is passed, and only a single option is available, automatically select that option without waiting for user input. The information usually printed during the selection screen is still printed.

Rationale: the only reason to have a selection when there is only one option, would be to have the option to cancel, but when I explicitly supply a filename, why would I want to? I know what I'm restoring (since I'm passing the filename).
When I don't supply a filename, it would IMO not be a good idea to skip this step; since 1. the user doesn't know what file they are restoring and 2. it could just be to list the files able to be restored.

restore_asking_the_user and RestoreAskingTheUser having a path specifically not asking the user is a bit weird, and could be improved; but I wasn't sure how, I would appreciate some help there.

mypy . passes
pytest passes

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.

1 participant