MediaArea / MediaConch

MediaConch (funded by PREFORMA)
31 stars 11 forks source link

feature request: exit status codes #229

Open brnco opened 2 years ago

brnco commented 2 years ago

I'd like to be able to evaluate the execution of the MediaConch CLI through the use of exit status codes. Using return codes would simplify Bash implementations of the MediaConch CLI by allowing the execution of MediaConch to be part of a conditional statement directly, e.g. if mediaconch -p policy.xml file.mkv; then...

Currently, MediaConch returns the same code, 0, for pass, fail, and error. To evaluate the pass/ fail/ error status of the execution, we have to parse the output text.

I think the following exit codes would suit my needs just fine: 0 = file passes validation 1 = file fails validation 2 = error in execution of MediaConch

You all are the best, thank you!

JeromeMartinez commented 2 years ago

Currently, MediaConch returns the same code, 0, for pass, fail, and error.

No more since https://github.com/MediaArea/MediaConch_SourceCode/pull/717 but globally true. At the beginning we were thinking to use status code only for feedback of error in execution of MediaConch, but having an error code also for failures makes also sense.

jens-st commented 12 months ago

I ran into this issue as well on automated archiving processes with file validation tasks. I'd like to request this feature too. Maybe not by default but would it be possible to add a pure optional argument for the CLI version that can reflect the validation status of the checked file in any way in the return code?

JeromeMartinez commented 12 months ago

@jens-st something doable, and right it may be better that it is an option in order to avoid incompatibility with previous version, or an option for previous behavior.

Still on our free support todo-list, no ETA.