Skip to content

Extract parseListOptions with validation and add --recursive flag#306

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
refactor/list-options-validation
Jun 29, 2026
Merged

Extract parseListOptions with validation and add --recursive flag#306
AndreyVMarkelov merged 1 commit into
masterfrom
refactor/list-options-validation

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extracts list option parsing into cmd/list_options.go with parseListOptions() that validates --sort, --time, and --time-format values before any API calls are made
  • Adds --recursive as the canonical long flag for ls, keeping --recurse/-R as backward-compatible aliases
  • Updates revs and search commands to use the new shared validator

Test plan

  • go test ./... passes
  • golangci-lint run ./... clean
  • gofmt -s -l . clean
  • New tests verify invalid --sort, --time, --time-format values are rejected in ls, revs, and search
  • New test verifies --recurse alias still sets recursive listing
  • Generated docs rebuilt and in sync

Moves list option parsing into a shared module (list_options.go) that
validates --sort, --time, and --time-format values before any API calls.
Adds --recursive as the canonical flag for ls, keeping --recurse/-R as a
backward-compatible alias.
@AndreyVMarkelov AndreyVMarkelov merged commit 0a4368c into master Jun 29, 2026
8 checks passed
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.

1 participant