Skip to content

feat: introduce notty flag for version command#82

Merged
redpanda-f merged 3 commits intomainfrom
feat/redpanda/noterminal-version-flag
Mar 11, 2026
Merged

feat: introduce notty flag for version command#82
redpanda-f merged 3 commits intomainfrom
feat/redpanda/noterminal-version-flag

Conversation

@redpanda-f
Copy link
Copy Markdown
Contributor

PR offshoot of #72, needed for cleaner report generation.

Copilot AI review requested due to automatic review settings March 9, 2026 09:08
@FilOzzy FilOzzy added this to FOC Mar 9, 2026
@redpanda-f redpanda-f requested review from BigLep and rvagg March 9, 2026 09:08
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Mar 9, 2026
@redpanda-f redpanda-f self-assigned this Mar 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a --noterminal option to the foc-devnet version subcommand so version output can be emitted without tracing formatting/prefixes, enabling cleaner capture by scripts/reporters.

Changes:

  • Extend the CLI Version subcommand to accept a --noterminal boolean flag.
  • Update main.rs routing to pass the flag through to the version handler.
  • Refactor version output to conditionally emit via tracing::info! vs println!, and extract relative-time formatting into a helper.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/main_app/version.rs Adds conditional emission (plain vs tracing) and factors out relative time formatting.
src/main.rs Routes Commands::Version { noterminal } into the updated handler signature.
src/cli.rs Adds the --noterminal flag to the version subcommand.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 9, 2026

@redpanda-f I've opened a new pull request, #86, to work on those changes. Once the pull request is ready, I'll request review from you.

…ive_time` (#86)

* Initial plan

* refactor: replace magic numbers with named constants in format_relative_time

Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@rvagg rvagg left a comment

Choose a reason for hiding this comment

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

A couple items:

  1. plain or some other standard idiom would be preferred to noterminal, even notty would be better; the more idiomatic a tool the better feel it has so always reach for something common

  2. why not just detect, this is the normal approach to such things and then you don't even need to think about it:

use std::io::IsTerminal;
let plain = !std::io::stdout().is_terminal();

@github-project-automation github-project-automation bot moved this from 📌 Triage to ⌨️ In Progress in FOC Mar 10, 2026
@redpanda-f
Copy link
Copy Markdown
Contributor Author

A couple items:

  1. plain or some other standard idiom would be preferred to noterminal, even notty would be better; the more idiomatic a tool the better feel it has so always reach for something common
  2. why not just detect, this is the normal approach to such things and then you don't even need to think about it:
use std::io::IsTerminal;
let plain = !std::io::stdout().is_terminal();

Let me try this approach

@redpanda-f
Copy link
Copy Markdown
Contributor Author

Fixed, added notty instead of noterminal, and .is_terminal() check

@redpanda-f redpanda-f changed the title feat: introduce --noterminal flag for version command feat: introduce notty flag for version command Mar 10, 2026
@BigLep BigLep requested a review from rvagg March 10, 2026 06:50
@BigLep BigLep moved this from ⌨️ In Progress to 🔎 Awaiting review in FOC Mar 10, 2026
@github-project-automation github-project-automation bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Mar 11, 2026
@redpanda-f redpanda-f merged commit d2c50f1 into main Mar 11, 2026
2 checks passed
@github-project-automation github-project-automation bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Mar 11, 2026
@redpanda-f redpanda-f deleted the feat/redpanda/noterminal-version-flag branch March 13, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

6 participants