Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ pub enum PythonListFormat {
Json,
}

#[derive(Debug, Default, Clone, clap::ValueEnum)]
pub enum SyncFormat {
/// Display the result in a human-readable format.
#[default]
Text,
/// Display the result in JSON format.
Json,
}
impl SyncFormat {
pub fn is_json(&self) -> bool {
matches!(self, SyncFormat::Json)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

A bit weird to impl this when we don't for the other formats, but 🤷‍♀️


#[derive(Debug, Default, Clone, clap::ValueEnum)]
pub enum ListFormat {
/// Display the list of packages in a human-readable table.
Expand Down Expand Up @@ -3187,6 +3201,10 @@ pub struct SyncArgs {
#[arg(long, conflicts_with = "all_extras", value_parser = extra_name_with_clap_error)]
pub extra: Option<Vec<ExtraName>>,

/// Select the output format.
/// **Note:** This option is only available when `--dry-run` is enabled.
#[arg(long, value_enum, default_value_t = SyncFormat::default())]
pub format: SyncFormat,
/// Include all optional dependencies.
///
/// When two or more extras are declared as conflicting in `tool.uv.conflicts`, using this flag
Expand Down
Loading
Loading