cr icon indicating copy to clipboard operation
cr copied to clipboard

Runtime stdout does not work

Open reggi opened this issue 8 years ago • 1 comments

Given this file:

Runtime:
  Stdout: true
Jobs:
  - Id: 'echo'
    Run: 'echo "hello"'

When I pass in --stdout.

➜  xxx git:(master) ✗ ../cr --file ./cr-example.yaml --stdout

        Starting execution.

        Logs directory: /tmp

echo    status=STARTED  start=13:30:25
hello
echo    status=SUCCESS  start=13:30:25  elapsed=6.562044ms

Without the flag, nothing:

➜  xxx git:(master) ✗ ../cr --file ./cr-example.yaml

        Starting execution.

        Logs directory: /tmp

echo    status=STARTED  start=13:30:28
echo    status=SUCCESS  start=13:30:28  elapsed=5.872205ms

reggi avatar Dec 18 '17 18:12 reggi

Yeah .. this is one is tricky as go-arg (the tiny lib that parses the cli args) doesn't make use of type references such that I can't distinguish easily by a value that has been set and is not a default (for instance, if it did, we could check if Stdout == nil and then we'd know that it was either set or not).

Maybe the best way of solving this one is just sticking with flag or performing some custom parsing with go-arg.

I see that what's provided by the cli is always meant to supersede what's defined in the configuration file, how do you feel about that?

thx!

cirocosta avatar Dec 18 '17 22:12 cirocosta