dcdpr / dcdpr/jp

Add explicit `--format` flag to CLI

Open
#72 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
16
Forks
3
Avg merge
1d 1h
Merged PRs (30d)
121

Description

Currently, the CLI auto-detects which formatting to use based on whether stdout is attached to a TTY. If it is, regular text is printed, otherwise the text is wrapped in a JSON object.

This has to be configurable:

  • text – regular text output, no ANSI escape codes
  • text-pretty – text output with ANSI escape codes (color, hyperlinks, other formatting)
  • json – compact JSON output
  • json-pretty – formatted multi-line JSON output

These options can be set globally using --format. This is separate from – and can be used in combination with – #37, which adds --[no-]stream, which allows output to either stream to the terminal, or be buffered and printed in a single call.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the CLI's existing TTY-based output-format detection and trace how output is produced. Implement the globally configurable text, text-pretty, json, and json-pretty modes, preserving compatibility with the separate --[no-]stream option; done means each mode produces its specified output and combinations with streaming behave correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.