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

[Question] How to correctly answer "Proceed? (y/n)" when using trash-empty in script? #333

Open
sudoshindo opened this issue Feb 13, 2024 · 5 comments

Comments

@sudoshindo
Copy link

I have been testing the behavior of trash-empty because I want to use it in a script.

I've found that doing echo 'n' | trash-empty or trash-empty <<< n still continues to empty the trash even though answering the prompt with n manually actually cancels the action.

I know that answering no/n is not something anyone would do in a script, but it bothers me that it doesn't behave consistently.

@sudoshindo
Copy link
Author

sudoshindo commented Feb 13, 2024

I did some code reading, I found that the -f flag found here is not included in the man page for trash-empty.

I often check a command's man page first. If the man page exists, I assume that it would show me the complete flags.

It would not have crossed my mind that I need to check -h or --help because it has completely different output from man command.

@sudoshindo
Copy link
Author

sudoshindo commented Mar 28, 2024

No manpage changes?

I found an answer to my question, but maybe you can make this specific information easier to find.

@andreafrancia andreafrancia reopened this Mar 28, 2024
@sudoshindo
Copy link
Author

Additional suggestion:

Also add an -f example to the README.

@andreafrancia
Copy link
Owner

Ok, we can reopen this.

If you want to be solved quickly you can change man pages by yourself and send a pull request, the file is man/man1/trash-empty.1.
If this is the case please include in the pull request form a screenshot of the man page rendering the part you've added.
You can render the man page without installing trashcli using man man/man1/trash-empty.1.

And you can add an -f example to README.

These documentation PR are very welcome.

@zunjack
Copy link

zunjack commented Sep 12, 2024

Same thing confused me when I tried to use it. Please tweak the manpage.

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

No branches or pull requests

3 participants