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

Hitting return on trash-restore without entering a number results in unclear behavior #326

Open
lukasvrenner opened this issue Jan 14, 2024 · 1 comment

Comments

@lukasvrenner
Copy link
Contributor

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

When restoring files using trash-restore, users are asked which files they would like to restore, and are able to enter a number. If there is only one option, 0 is the only input option. The behavior is unclear when return is pressed, without entering a number. With no input other than hitting enter, the program exits, printing out nothing, with a successful exit code (0). It is unclear whether or not the file is restored.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
A few options to mitigate this confusion are:

  • exit with a non-zero exit code -- this would show that the trash-restore has failed to restore any files
  • print out "No files restored" or something similar to the console -- this clarifies that nothing happened
  • describe the behavior of simply pressing return when options are given in the prompt (i.e. "What file to restore: [0..9] (hit return to cancel):

Describe the solution you'd like
A clear and concise description of what you want to happen.
In my opinion, the best option would be to implement all three of my proposals.

Additional context
Add any other context or screenshots about the feature request here.

@andreafrancia
Copy link
Owner

Hi @lukasvrenner ,
About the options you considered:

  • exit with a non-zero exit code -> I prefer to still use the zero exit code because is ok not to restore anything.
  • print out "No files restored" -> good, I just merged your code
  • (hit return to cancel) -> interesting, if you want (or anyone other) you can push another PR with this addition

Thank you

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 a pull request may close this issue.

2 participants