CLI Exit Code

Discussion of the HandBrake command line interface (CLI)
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
bernardh
Posts: 1
Joined: Mon Jul 22, 2013 12:19 pm

CLI Exit Code

Post by bernardh »

I am sure there's something that I am misunderstanding here, so thanks in advance for your patience!

The CLI guide says that HandbrakeCLI has two exit codes: 0=clean; 1=unspecified error. However, when I call the CLI I get something more like an activity log returned:

Encoding: task 1 of 1, 0.00 %
Encoding: task 1 of 1, 0.00 %
Encoding: task 1 of 1, 0.00 %
Encoding: task 1 of 1, 0.00 %
Encoding: task 1 of 1, 0.00 %
...

Is there some way that I can call the CLI and limit the return code to something that I can test (so that I can then go on to delete the original file/s)?

[I am calling the shell from AppleScript under OS X which probably limits me. However, I can use just shell scripting if someone can suggest a way to do what I want by monitoring stdout or stderr - as I notice these are mentioned in the guide.]
Post Reply