Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Change file descriptor to stderr if status more then zero #19

Conversation

FCesar
Copy link

@FCesar FCesar commented Apr 24, 2020

Hello everybody,

I propose redirect stdout to stderr if status more than 0, in my humble opinion, this behavior make a sense

What do you think about ?

@ckstettler
Copy link
Contributor

This sounds reasonable to me. Would you be willing to sign the Contributors agreement found in the readme?

@FCesar
Copy link
Author

FCesar commented Apr 24, 2020

@ckstettler , I will read this section of readme first.

@FCesar
Copy link
Author

FCesar commented Apr 24, 2020

@ckstettler , done I accepted individual terms.

But, what do you think, of adding this new behavior in the readme, before diving into this pr?

@FCesar
Copy link
Author

FCesar commented Apr 25, 2020

@ckstettler , I already adjust in --output option. for me merge just be done

|--output|Text string to echo if there is a match.|No.
|--output|Text string to echo if there is a match.

But if `--status` is more then 0, echo redirect message to stderr.|No.
Copy link
Contributor

Choose a reason for hiding this comment

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

is more "than" 0

local out
out=$($ECHO "$output" | $AWK 'BEGIN{FS="%%"}{ for (i=1;i<=NF;i++) {print $i}}')

if [ "$status" -ge 0 ] ; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Another thought here may be to allow --error to be specified separately allowing the user to have more control over what got written to the various file handles.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, but not understood. You can explain better?

Copy link
Author

Choose a reason for hiding this comment

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

I think I understand, you wrote. But allow --error, in my opinion, allow more mistakes. Because the user can be configured - status 0 and --error at the same time. Does not make sense. My opinion is --output is the best approach

@CLAassistant
Copy link

CLAassistant commented Jul 21, 2020

CLA assistant check
All committers have signed the CLA.

@ckstettler
Copy link
Contributor

Did you sign the license agreement?

@tyleroconnell
Copy link
Member

@FCesar I'm going to close this since we are unable to accept changes from folks that haven't signed our Contributor License Agreement. Please let me or @ckstettler know if you change your mind and would like these changes merged

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants