kubectl-slice icon indicating copy to clipboard operation
kubectl-slice copied to clipboard

Add support for silent operation

Open ianseyer opened this issue 3 years ago • 2 comments

Hello,

I am using this module as a static library, for use within a Go application.

It would be great to be able to create a Split object that is silent (i.e. does not print anything to StdErr).

ianseyer avatar Feb 18 '22 17:02 ianseyer

Hey @ianseyer!

Thanks a lot for this, appreciate the PR as well!

I think I'll merge the PR but keep this issue open. I think there could be a bit of a better way to handle it for any other resource coming forward -- knowing that the app could continue to grow. I'm thinking something along the lines of having an io.Writer where if -q is enabled then it would simply set the writer to something like ioutil.Discard. That, or a logging library of some sorts.

Thanks a lot for your contribution!

patrickdappollonio avatar Feb 18 '22 18:02 patrickdappollonio

Hey @ianseyer!

I'm planning to retake some of this soon. In the meantime, I'm also planning to add #66 however just in the CLI side of things. I imagine you want to keep it to your own settings, so it won't be a "package-related change" (to the slice package) but instead just to the CLI.

Just giving you the heads-up in case you have any concerns. Thank you!

patrickdappollonio avatar Feb 20 '23 03:02 patrickdappollonio