Skip to content

Standardize --output to work for all formats #1177

@LalatenduMohanty

Description

@LalatenduMohanty

Problem

Commands that accept --format and -o handle file output inconsistently:

Command Plain format -o with plain format
find-updates requirements Works
package list-versions (#1127) versions, requirements Warns and ignores
list-overrides default (no --details) Warns and ignores

Raised in #1127 review. Only list-overrides uses warn-and-ignore today; find-updates is the reference.

Proposed standard

Commands already share --format + -o. Users should not need to know which formats honor -o and which do not.

-o means "write output here." Always.

  • -o set → write to file; stdout empty (logs on stderr only)
  • -o omitted → write to stdout
  • No silent or warn-and-ignore behavior

Reference: src/fromager/commands/find_updates.py

Scope

  1. package list-versions — wire -o into plain formats; remove feat(list-versions): show cooldown status and upload timestamps #1127 warning
  2. list-overrides — write plain name list to -o; remove warnings
  3. Tests-o creates file with expected content; no -o prints to stdout
  4. Docs — one line in help or CONTRIBUTING stating the rule above

Out of scope: cooldown filtering behavior (#1078/#1127), commands without a format split (build-order, graph, minimize).

Related: #1165 covers output plumbing (click.File, dedupe writers); this issue defines the behavioral contract.

Acceptance criteria

  • Plain formats honor -o on list-versions and list-overrides
  • No "--output option is ignored…" warnings
  • find-updates unchanged
  • Tests for plain-format file output

Feedback welcome

This proposes one UX rule, but alternatives exist — please comment if you prefer a different approach:

  • Option A (proposed): -o works for every format, matching find-updates
  • Option B: keep plain formats stdout-only, but warn when -o is passed (current feat(list-versions): show cooldown status and upload timestamps #1127 approach for list-versions)
  • Option C: restrict -o to detail formats only (hide or reject -o for plain formats via CLI validation)

Happy to adjust before implementation. #1127 can land with a temporary compromise if needed; this issue tracks the longer-term standard.

References

#1078 · #1127 · #1165

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions