Skip to content

Conversation

@Timpan4
Copy link
Contributor

@Timpan4 Timpan4 commented Nov 18, 2025

Fixes #101

Changes

Core Functionality

  • Shared display logic: Extracted ~80 lines of duplicate YAML formatting code into a reusable _format_and_display_tasks() method
  • Unified output format: Both maniphest show and maniphest search now produce identical YAML output
  • New task_show() method: Uses modern maniphest.search API instead of deprecated maniphest.info for consistency

Command-Line Interface

  • Added --show-history flag: Display transition history for columns, priority, and status (both commands)
  • Added --show-metadata flag: Display metadata about filter matches (both commands)
  • Backward compatibility: --all flag now maps to --show-history for consistency
  • Legacy support: --pp flag preserved for users who need the old pretty-print format

Examples

# Before: Inconsistent flags and output formats
$ phabfive maniphest show T123 --all        # Plain text with transitions
$ phabfive maniphest search Project         # YAML format

# After: Consistent flags and output
$ phabfive maniphest show T123              # YAML format (basic)
$ phabfive maniphest show T123 --show-history       # YAML with history
$ phabfive maniphest show T123 --show-metadata      # YAML with metadata
$ phabfive maniphest search Project --show-history  # Same YAML format

# Backward compatibility maintained
$ phabfive maniphest show T123 --all        # YAML with history (same as --show-history)
$ phabfive maniphest show T123 --pp         # Legacy pretty-print format

Sample Output

Both commands now produce identical structured YAML:

- Link: http://phorge.domain.tld/T1
  Task:
    Name: '[EPIC] GUNNAR Gen1 Chip Architecture Design'
    Status: Open
    Priority: High
    Created: '2025-10-01T17:21:53'
    Modified: '2025-10-01T17:21:54'
    Description: |-
      Complete initial architecture design...
  Boards:
    Architecture:
      Column: Backlog
    GUNNAR-Core:
      Column: Backlog
  History:  # Only with --show-history or --all
    Priority:
    - 2025-10-01T17:21:53 [↓] Triage → High
  Metadata:  # Only with --show-metadata
    MatchedBoards: []
    MatchedPriority: false
    MatchedStatus: false

Technical Details

  • Zero code duplication: Display logic lives in single _format_and_display_tasks() method
  • Consistent API usage: Both commands now use maniphest.search API for modern feature support
  • Maintains backward compatibility: Old maniphest.info API still used by --pp flag
  • Modular design: Easy to add new display sections (just update shared method)

Benefits

  1. Consistent user experience - Same flags and output format across commands
  2. Reduced maintenance - Display logic in one place, easier to fix bugs and add features
  3. Better structure - YAML output is parseable and more machine-friendly
  4. Backward compatible - Existing workflows continue to work with minor format improvements
  5. Future-proof - New features (like --show-history) work in both commands automatically

- Refactor task display with unified `task_show()` method
- Add `--show-history` and `--show-metadata` CLI options
- Improve output formatting with YAML and transition history
- Update version to 0.5.0rc0
- Deprecate legacy `--all` flag in favor of new options
Fix linting
@Timpan4 Timpan4 requested a review from holmboe November 18, 2025 15:42
Copy link
Contributor

@holmboe holmboe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. Personally I am fine with removing the legacy stuff. Up to you to decide before merge. 👍

@Timpan4
Copy link
Contributor Author

Timpan4 commented Nov 20, 2025

Removed the legacy --pp flag as well. Everything now uses the consistent YAML output format. 👍

@Timpan4 Timpan4 force-pushed the feat-task-display-cli-options branch 3 times, most recently from 90680f3 to 8ecef04 Compare November 20, 2025 13:10
@Timpan4 Timpan4 merged commit 7582a0f into master Nov 20, 2025
15 checks passed
@Timpan4 Timpan4 deleted the feat-task-display-cli-options branch November 20, 2025 13:15
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.

Output of maniphest show and maniphest search should be aligned

3 participants