Skip to content

audiocpp_cli silently ignores unknown options #338

Description

@avionicharshit-byte

a misspelled flag is dropped without a word. --bakend cuda runs on cpu and exits 0, so you believe you got a cuda run and nothing says otherwise.

built at a76ec04 on macos arm64, cmake -DAUDIOCPP_MODEL_SET=custom -DAUDIOCPP_MODELS=citrinet_asr

audiocpp_cli --list-loaders --bakend cuda
# registered_loaders=3
# citrinet_asr: asr (offline)
# marblenet_vad: vad (offline)
# silero_vad: vad (offline|streaming)
# exit 0, no warning

audiocpp_cli --list-loaders --this-flag-does-not-exist
# same output, exit 0

audiocpp_cli --task asr --family citrinet_asr --model <path> --sesion-option a=b
# the session option is silently dropped

a wrong value is caught, --backend notreal fails with unsupported backend: notreal. it is only the option name that goes unchecked.

cause is in app/cli/args.cpp: find_arg, has_arg and collect_args each scan argv for the one name they expect, and nothing ever looks at what is left over, so an unmatched token just disappears.

the other binary in this repo already does the opposite. app/model_manager/main.cpp:61 walks its arguments and throws unknown option: on anything it does not recognise, so the two CLIs disagree on this today.

happy to send the patch, one question first. do you want a warning on stderr that leaves the exit code and stdout alone, or a hard error? a hard error is stricter but would break any script that passes a stray flag today, so i have a warning working locally and can switch it either way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions