Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SubtitleEdit CLI output to stderr(or exit code) #8162

Open
Hlsgs opened this issue Apr 10, 2024 · 0 comments
Open

SubtitleEdit CLI output to stderr(or exit code) #8162

Hlsgs opened this issue Apr 10, 2024 · 0 comments

Comments

@Hlsgs
Copy link

Hlsgs commented Apr 10, 2024

I am unaware of standardized method to determine if SubtitleEdit CLI was successful. Right now, I'm regex-ing through it's console output to determine how many files were converted(I only do one file at a time, not entire folders; so "0 file(s) converted" means error and "1 file(s) converted" means success).

Seeing as SE is not a really a CLI, as you've mentioned here, I presume that it can't emit a proper exit code, but, it should be able to output to stderr, which would prompt Powershell to populate it's $? automatic variable:

In the case of calling an external program, if any information output is passed to stderr then PowerShell will set $? to $false.

What I'm doing works, but it's dependant on SE's console output, which you may choose to alter at some point. Whereas outputting to stderr would be robust.

Thank you!

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

No branches or pull requests

1 participant