Skip to content

fix(lend): mark --protocol, --chain, --asset as required cobra flags#9

Open
silicon-intern wants to merge 1 commit intoggonzalez94:mainfrom
silicon-intern:lend-required-flags
Open

fix(lend): mark --protocol, --chain, --asset as required cobra flags#9
silicon-intern wants to merge 1 commit intoggonzalez94:mainfrom
silicon-intern:lend-required-flags

Conversation

@silicon-intern
Copy link

What

Adds MarkFlagRequired calls for --protocol, --chain, and --asset on both lend markets and lend rates commands.

Why

These flags are validated manually in the RunE handlers, but cobra doesn't know they're required. This means:

  • defi lend markets --help doesn't show them as required
  • defi schema lend markets doesn't reflect them in machine-readable output
  • Error messages are less standard than cobra's built-in required flag errors

Other commands like bridge quote already use MarkFlagRequired correctly.

Changes

  • internal/app/runner.go: Add MarkFlagRequired for protocol/chain/asset on marketsCmd and ratesCmd

The manual validation in RunE is kept as defense-in-depth (it also handles normalization).

Closes #7

These flags were validated manually in RunE but not marked as required
via cobra, so help output and machine-readable schema didn't reflect
them as required. This aligns lend commands with bridge quote which
already uses MarkFlagRequired.

Closes ggonzalez94#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant