You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(cli): deduplicate accent helpers into crate::help (#2363)
## Description
The global CLI carried five copies of the same terminal-styling helpers:
- `accent` was duplicated in `commands/version.rs` and
`commands/env/current.rs`.
- `accent_command` was duplicated in `commands/env/on.rs`,
`commands/env/off.rs`, and `commands/env/setup.rs`.
All copies were byte-identical apart from the backtick wrapping in
`accent_command`, and every one of them already depended on
`help::should_style_help()`. This PR moves a single `accent` into
`crate::help` next to the other styling helpers, reimplements
`accent_command` as a one-line wrapper around it, and deletes the five
local copies. The now-unused `owo_colors::OwoColorize` imports in the
five call-site files are removed as well.
Output is byte-for-byte identical, so no PTY snapshots change.
## Changes
- Add `help::accent` and `help::accent_command` to
`crates/vp_global_cli/src/help.rs`.
- Remove local duplicates and switch call sites to the shared helpers in
`commands/version.rs`, `commands/env/current.rs`, `commands/env/on.rs`,
`commands/env/off.rs`, and `commands/env/setup.rs`.
0 commit comments