Skip to main content

heddle_cli_args/cli/cli_args/
output_mode.rs

1// SPDX-License-Identifier: Apache-2.0
2//! CLI-local parsing shape for shared output modes.
3
4use cli_shared::OutputMode;
5
6#[derive(Copy, Clone, Debug, PartialEq, Eq, clap::ValueEnum)]
7pub enum CliOutputMode {
8    Json,
9    // JSON, but only the decision-surface fields (heddle#470). Keep this
10    // comment non-doc so clap's compact help layout stays byte-stable.
11    JsonCompact,
12    Text,
13}
14
15impl From<CliOutputMode> for OutputMode {
16    fn from(mode: CliOutputMode) -> Self {
17        match mode {
18            CliOutputMode::Json => OutputMode::Json,
19            CliOutputMode::JsonCompact => OutputMode::JsonCompact,
20            CliOutputMode::Text => OutputMode::Text,
21        }
22    }
23}