From 9b896d697eb582dedd2533f6d2054f062c8381a0 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 20 Jun 2026 07:20:46 +0800 Subject: feat: add custom help message and fix clap help conflict Disable clap's built-in help flag and reroute `-h`/`--help` to print an embedded help text from `help.txt`. Use `try_parse` to avoid clap's default exit on parse failure, allowing custom error output. --- help.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 help.txt (limited to 'help.txt') diff --git a/help.txt b/help.txt new file mode 100644 index 0000000..013c782 --- /dev/null +++ b/help.txt @@ -0,0 +1,33 @@ +Usage: dmvop [OPTIONS] + +Options + --device= Microphone (WASAPI name or device ID). Required. + -O, --output= Output destination(s). May be repeated. [default: stdout] + stdout | stderr | tcp | udp | udp-broadcast | ipc + -m, --model= Whisper model. [default: base_en] + --lang= Language hint (zh, ja, en, fr...). Skips detection. + -f, --format= Output format with %{vol}, %{word}, %{confid}. + [default: %{vol},%{word}] + -S, --format-file= Read format from file. + -p, --port= Port for TCP/UDP modes. [default: 5117] + --socket-file= Unix socket path for IPC. [default: ./dmvop.sock] + --subnet-mask= Subnet mask for UDP broadcast. + [default: 255.255.255.0] + -L, --list-devices List microphones and exit. + --list-models List Whisper models and exit. + --download-model= Download a model and exit. + -V, --verbose Show debug output. + -h, --help Show this help. + +Examples + dmvop --list-devices + dmvop --device="My Mic" -O stdout -O tcp -m small --lang=zh + dmvop --device="My Mic" -f "[%{vol}] %{word}" + dmvop --device="My Mic" -O udp-broadcast -p 8888 + dmvop --download-model=small + +Notes + - First run downloads the model (~142 MB for base_en). + - Use --verbose to see speech events and timing. + - Ctrl+C to stop. + - All outputs initialize in parallel. -- cgit