-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
cp
: add progress bar
#3903
cp
: add progress bar
#3903
Conversation
it is magic how small it is :) |
Indeed! |
what about adding an option |
Yeah that makes sense. I added I think a compile-time flag might be unnecessary, because the bloat by |
4ae15d0
to
2ccf3c8
Compare
Maybe we should have a page in which we list all the stuff that we added compared to GNU's? for example, I think we have more hashing functions |
I'll add something like that to the docs in this PR. I'll also add the bar to We can also bikeshed the layout and appearance of the bar itself. I think it makes sense to put |
I changed my mind about With the documentation on the extensions over GNU, I think this is ready. |
@@ -938,7 +952,22 @@ fn copy(sources: &[Source], target: &TargetSlice, options: &Options) -> CopyResu | |||
let mut non_fatal_errors = false; | |||
let mut seen_sources = HashSet::with_capacity(sources.len()); | |||
let mut symlinked_files = HashSet::new(); | |||
for source in sources { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs some rustfmt ;)
5ffcec2
to
b75dc0a
Compare
sorry, I think I failed as fixing the conflicts :( |
8bc5a97
to
6ff7684
Compare
small error:
|
Welp, looks like it's blocked. So I think we'll have to make an exception in |
GNU testsuite comparison:
|
@@ -0,0 +1,31 @@ | |||
# Extensions over GNU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love that file :)
needs rebasing again, sorry :( Once done, if the CI is green, please land it :) |
3acf5f3
to
756223d
Compare
Adds the `-g` and `--progress` flags to enable a progress bar via indicatif.
docs: fix typos in extensions page
756223d
to
b821d21
Compare
GNU testsuite comparison:
|
sorry it took that long :) |
Would it be possible to add progress bar for |
@doronbehar I found that |
Maybe mv can be slow when moving between disks. (ex sdd - > USB) |
That's exactly the use case I was thinking about. |
That makes sense! I'll open a new issue for it. |
Closes #1455
Based on the recent discord discussion around #1455, I figured I would give it a go to see what the feature would look like. This is mostly meant to spark some discussion about what this should look like and how it should behave.
Details of this implementation:
indicatif
is used to draw the progress bar.du
)cp
with the symlink options as that wouldn't actually copy that many bytes.If we actually want to land this, the progress bar (and accompanying performance hit) would of course need to be opt-in. I'm leaning towards adding both a compile-time feature gate and a run-time flag to enable this.
This is what it looks like:
![image](https://user-images.githubusercontent.com/11643477/188410477-db556957-49d1-4ef7-9f80-927b155bc0b6.png)