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

Progress bar on nats object put|get work inverted #593

Closed
rickardgranberg opened this issue Sep 30, 2022 · 2 comments
Closed

Progress bar on nats object put|get work inverted #593

rickardgranberg opened this issue Sep 30, 2022 · 2 comments

Comments

@rickardgranberg
Copy link
Contributor

rickardgranberg commented Sep 30, 2022

Was doing some testing of the Object Store feature and didn't understand why I didn't see the progress bars.

I ran: nats object put <bucket> <file> and nats object put --progress <bucket> <file> expecting to see a progress bar but did not. And yes, my file was over 20480 bytes.

To my surprise, running nats object put --no-progress <bucket> <file> makes the progress bar appear!

I've traced it to the lines

put.Flag("progress", "Disables progress bars").Default("true").BoolVar(&c.noProgress)
get.Flag("progress", "Disables progress bars").Default("true").BoolVar(&c.noProgress)

The flag is named --progress with a default of true but the variable it's assigned to is named noProgress and it's used in that capacity on line

if !opts.Trace && !c.noProgress && stat != nil && stat.Size() > 20480 {
and
if !opts.Trace && !c.noProgress && nfo.Size > 20480 {

I'll be happy to provide a PR with a fix, but I'm a little uncertain if the intention was to have progress enabled or disabled by default.

@ripienaar
Copy link
Collaborator

hmmm, yeah i think logic is just reversed, should be always on

@rickardgranberg
Copy link
Contributor Author

Alright. I'll work on a fix

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