stackabletech / stackabletech/stackablectl
feat: Implement colored output (with `NO_COLOR` support)
まだ誰も着手していません。
- 主要言語
- Rust
- スター
- 10
- フォーク
- 5
- 平均マージ
- 4時間 41分
- マージ済み PR(30日)
- 4
説明
Colours sould only be enabled when the terminal supports them.
For example, when redirecting output or piping to cat, there should be no escape sequences.
I believe there needs to be a condition around the pretty method (or maybe it should be handled by tracing_subscriber::fmt):
Examples:
stackablectl --log-level=DEBUG stack list > /tmp/stackablectl.stdout # plain redirect
stackablectl --log-level=DEBUG stack list | cat > /tmp/stackablectl.stdout # pipe through cat
TERM= stackablectl --log-level=DEBUG stack list > /tmp/stackablectl.stdout # explicitly set TERM to nothing
If I open it in VIM, it looks like this:
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
rust/stackablectl/src/main.rs のリンクされた pretty メソッド周辺から始め、tracing_subscriber::fmt が端末の検出を担当すべきかどうかを比較してください。空の TERM を含め、記載された stackablectl コマンドを出力をリダイレクトおよびパイプした状態で実行し、非対話的な出力にエスケープシーケンスが含まれない一方で、サポートされている端末の出力はカラーのままであり、NO_COLOR が尊重されることを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- rust
- 領域
- cli
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 50/100