Giter VIP home page Giter VIP logo

Comments (10)

andreafrancia avatar andreafrancia commented on July 21, 2024 3

Since commit 2fad485 trash-empty asks for confirmation when standard input is interactive. When standard input is not interactive (e.g. trash-empty is launched from a script) it keeps the old behaviour.

from trash-cli.

Potherca avatar Potherca commented on July 21, 2024 2

Maybe the best way to go is for users that require a confirmation to use an alias for trash-empty?

from trash-cli.

buhtz avatar buhtz commented on July 21, 2024 2

I vote for #Close because of backwards-compatibility. I assume there are a lot of scripts using trash-cli that would broke when such a security-question is added as default behavior.

trash-cli is not for Windows or Apple users. ;)

The trash-can itself is a "security layer". So the file stil was "deleted" in a conceptual way. Now asking the user again if she/he really want's to delete a deleted file...

This is also related to (still closed) #10 and #33

from trash-cli.

andreafrancia avatar andreafrancia commented on July 21, 2024 1

@Potherca it would be a good idea but it would break the retro-compatibility

from trash-cli.

asakura42 avatar asakura42 commented on July 21, 2024 1

I use this function:

trash-empty () {
  /usr/bin/trash-list
  echo ""
  echo -n "Continue? "
  read REPLY

  if [[ $REPLY =~ ^[Yy]$ ]]
  then
	/usr/bin/trash-empty $1
  fi
}

from trash-cli.

afcuttin avatar afcuttin commented on July 21, 2024

I agree.
Another option is for trash-empty to require a mandatory argument, like trash-empty 0 to clean everything.
If no argument is provided, the help can be shown.

from trash-cli.

Potherca avatar Potherca commented on July 21, 2024

Instead of stating "it should be thus" can either of you explain the rationale why it should be so?

from trash-cli.

amishmm avatar amishmm commented on July 21, 2024

Because it can be run by accident?

Whole purpose of trash-cli to avoid accidental deletion and easy recovery in such cases.

So trash-empty can also be run by mistake.

Say for example instead typing trash-r-TAB-ENTER I type trash-e-TAB-ENTER (E and R are very close on keyboard).

Now tab completion will run trash-empty instead of trash-rm and EMPTY whole trash accidentally.

So confirmation like "Are you sure, you want to empty trash?" should exist by default.

I know this can be done by shell function over-riding actual trash-empty command (which is what I have done) but in my opinion it should be default. as it is otherwise a complete destruction without confirmation! :)

from trash-cli.

Potherca avatar Potherca commented on July 21, 2024

@andreafrancia Do you have any opinions on the matter?

from trash-cli.

GregTheHun avatar GregTheHun commented on July 21, 2024

@Potherca it would be a good idea but it would break the retro-compatibility

I'm confused which "retro-compatibility" this might be referring to?

from trash-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.