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

Make the output machine readable #18

Merged
merged 7 commits into from
Nov 24, 2021
Merged

Make the output machine readable #18

merged 7 commits into from
Nov 24, 2021

Conversation

donovanhubbard
Copy link
Contributor

@donovanhubbard donovanhubbard commented Nov 21, 2021

I want the run the script as a batch job for monitoring purposes but the current output is difficult to read in a script. I converted the script to be more machine readable by

  • adding a --silent switch to suppress status output until the end
  • adding -k, -m, and -g switches to force output into kbps, mbps, or gbps respectively.
  • Changed return codes when the program fails to be non-zero

This PR includes the go modernization changes written by musl's change request.

@donovanhubbard donovanhubbard changed the title Flags Make the output machine readable Nov 21, 2021
@ddo
Copy link
Owner

ddo commented Nov 22, 2021

make sure to update the README as well. then i will check the commits
ty

@donovanhubbard
Copy link
Contributor Author

Updated the README.

@ddo
Copy link
Owner

ddo commented Nov 23, 2021

Do you use go fmt for formating the go files?

fast.go Outdated
for Kbps := range KbpsChan {
status = format(Kbps)
}
value,units = format(Kbps,kb,mb,gb)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line should be:

value, units = format(Kbps, kb, mb, gb)

if run go fmt?

@donovanhubbard
Copy link
Contributor Author

donovanhubbard commented Nov 24, 2021

I ran go fmt on fast.go

@ddo
Copy link
Owner

ddo commented Nov 24, 2021

thanks. will merge soon today

@ddo ddo merged commit f422e52 into ddo:master Nov 24, 2021
@ddo
Copy link
Owner

ddo commented Nov 24, 2021

will update snap and docker later

@donovanhubbard donovanhubbard deleted the flags branch November 24, 2021 16:48
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

Successfully merging this pull request may close these issues.

2 participants