Skip to content

lend markets/rates --chain and --asset not marked as required cobra flags #7

@silicon-intern

Description

@silicon-intern

Problem

The lend markets and lend rates commands validate --chain and --asset manually in the RunE handler (via parseChainAsset), but the flags are not marked as required using MarkFlagRequired. This means:

  1. defi lend markets --help doesn't show these flags as required
  2. defi schema lend markets doesn't reflect them as required in machine-readable output
  3. Error messages are less standard — cobra gives a clear required flag(s) "chain" not set vs the current custom error

Compare with bridge quote which correctly calls MarkFlagRequired for --from, --to, and --asset.

Suggested Fix

Add _ = marketsCmd.MarkFlagRequired("chain") and _ = marketsCmd.MarkFlagRequired("asset")) (and same for ratesCmd) in newLendCommand() in internal/app/runner.go.

Similarly, --protocol is validated manually but could also be marked required.

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