Skip to content

UX: ping --ip help text misleading; use MarkFlagsOneRequired for operatorsInfo #237

Description

@olegshmuelov

Problem

The --ip flag help for ping is misleading:

Operator endpoint(s) to ping (https://host:port). If empty, pings all
operators from operatorsInfo

This implies --ip is primary and --operatorsInfo is a fallback. In
reality, --operatorsInfo (or --operatorsInfoPath) is required for
identity verification; --ip is an optional filter to target a subset of
operators.

Users running ssv-dkg ping --ip https://host:3030 without operatorsInfo
get a runtime error ("operators info should be provided..."). Functional but
confusing — help text doesn't reflect the new requirement introduced in
v3.1.0.

Proposed fixes

1. Update --ip description (cli/flags/healthcheck.go:8)

"Optional filter: specific operator endpoints (https://host:port) to ping. "
"Requires --operatorsInfo or --operatorsInfoPath. "
"If omitted, pings all operators from operatorsInfo."

2. Use cobra's MarkFlagsOneRequired

Move the runtime check to parse-time via cobra:

cmd.MarkFlagsOneRequired("operatorsInfo", "operatorsInfoPath")
cmd.MarkFlagsMutuallyExclusive("operatorsInfo", "operatorsInfoPath")

This replaces the manual check in cli/initiator/initiator_health_check.go
and surfaces the error before the binary does any setup — better UX.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions