Send progress output to stderr instead of stdout
Pull Request Description
Fix for Issue #388: Spinner Output Cleanup
This pull request addresses the issue described in GitHub issue #388, where the spinner output was generating unprintable characters.
Changes Made:
Initialized the spinner with a default stderr writer.
Redirected all spinner output to stderr, ensuring that it does not interfere with standard output.
This adjustment prevents any unprintable characters from appearing in the final output, enhancing the overall user experience when using the CLI.
Before Change -
After Change -
Impact: This change improves the clarity and usability of the Civo CLI by ensuring that output for this particular command (with -wait flag) is formatted correctly in every case.
@uzaxirr @fernando-villalba For now, I have only proposed a solution for the command mentioned in the ticket. If this approach looks good, I can raise similar changes for subsequent commands that support the -wait flag as well.
Hi @dipu989 , i've seen we are already doing that, such as here
s := spinner.New(spinner.CharSets[9], 100*time.Millisecond)
s.Writer = os.Stderr
This could be done better in my opinion using the spinner.WithWriter function you used in this PR instead of a new line for setting the writer to Stderr.
If you will open a PR for that, I will be happy to review it
I agree with @fulviodenza. I like this approach better than what we currently have.