]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
cli : support "-" for stdout like stdin (#3050)
authorDaniel Tang <redacted>
Mon, 5 May 2025 05:15:39 +0000 (01:15 -0400)
committerGitHub <redacted>
Mon, 5 May 2025 05:15:39 +0000 (07:15 +0200)
commit934d4b30837be191100c4939ffe966f1fd397ff6
treea56af4a063a7a30b12c867ef4709bf1d3dfaa3a9
parent988dcd4b5b083429bd26e1217ec35c7a12a23944
cli : support "-" for stdout like stdin (#3050)

This changes examples/cli/cli.cpp to be like
examples/common-whisper.cpp. "-of -" can be specified (or this can be
inferred from "-" as the input file) to output to stdout. This is useful
for piping to other applications.

Log fname_out consistently when not stdout
- Terminals have stdout=stderr, so remove the message before
  successful output to ease copying
- Don't affect actual error messages
- Move opening the ofstream into the factory, fixing missing
  open and/or error messages in output_score/output_wts
- Fix struct naming convention

Closes #3048
examples/cli/cli.cpp