Skip to content

-v and -s together resolve silently instead of warning #29

Description

@korya

Problem

mustParseLogLevel checks verbose before silent, so -v silently wins when both are given. No warning is emitted.

Reproduction

$ http-assert -v -s --assert-ok http://127.0.0.1:8791/ok
[.] HTTP/1.1 GET http://127.0.0.1:8791/ok
[:] HTTP/1.1 200 OK
[+] PASSED

The -s is silently ignored. This matters most when one of the two arrives from an environment variable (HTTP_ASSERT_SILENT) and the other from the command line — the user has no idea which won.

Suggested fix

Treat mutually exclusive verbosity flags as a usage error, or at minimum log a warning naming the winner. Cobra's MarkFlagsMutuallyExclusive covers the CLI half.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions