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

Group removals by invocations #10

Open
jhasse opened this issue Feb 20, 2019 · 3 comments
Open

Group removals by invocations #10

jhasse opened this issue Feb 20, 2019 · 3 comments

Comments

@jhasse
Copy link

jhasse commented Feb 20, 2019

I often clear directories with lots of files using rip *. If I want to undo that operation, rip -u will only undo one deletion, since the shell expands * into all files in the current directory.

As an alternative I can do rip $PWD, but this break my shell, as it also removes the current working directory itself.

So my suggestion would be that rip -u would undo the last invocation. E.g. after doing rip a b, rip -u would restore both a and b.

@nivekuil
Copy link
Owner

nivekuil commented Feb 20, 2019

Thanks for using rip! From a UX standpoint this makes total sense, but I don't know of a good way to implement this. The challenge is that glob expansion happens in the shell, before the argument is passed in the program. So as far as rip is concerned, these are totally separate invocations. One possible solution would be to dig into the bash_history/zhistory etc. and infer batching from that but I would like to figure out something less hacky.

Another way might be to write timestamps to the graveyard file and have -u restore everything within a certain margin of the last entry. That seems better but still might have result in some weird interactions.

@jhasse
Copy link
Author

jhasse commented Feb 21, 2019

So as far as rip is concerned, these are totally separate invocations.

Isn't it one invocation with several arguments?

@nivekuil
Copy link
Owner

nivekuil commented Feb 21, 2019 via email

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

2 participants