Skip to main content

uv_configuration/
output_format.rs

1/// The output format for listing Python installations.
2#[derive(Debug, Default, Clone, Copy)]
3#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4pub enum PythonListFormat {
5    /// Plain text (for humans).
6    #[default]
7    Text,
8    /// JSON (for computers).
9    Json,
10}
11
12/// The output format for audit findings.
13#[derive(Debug, Default, Clone, Copy)]
14#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
15pub enum AuditOutputFormat {
16    /// Display the result in a human-readable format.
17    #[default]
18    Text,
19    /// Display the result in JSON format.
20    Json,
21    /// Display the result in SARIF format.
22    Sarif,
23}
24
25#[derive(Debug, Clone, Copy)]
26#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
27pub enum VersionFormat {
28    /// Display the version as plain text.
29    Text,
30    /// Display the version as JSON.
31    Json,
32}
33
34#[derive(Debug, Default, Clone, Copy)]
35#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
36pub enum SyncFormat {
37    /// Display the result in a human-readable format.
38    #[default]
39    Text,
40    /// Display the result in JSON format.
41    Json,
42}
43
44#[derive(Debug, Default, Clone, Copy)]
45#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
46pub enum PipInstallFormat {
47    /// Display the result in a human-readable format.
48    #[default]
49    Text,
50    /// Display the result in JSON format.
51    Json,
52}
53
54#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
55#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
56pub enum TreeFormat {
57    /// Display the dependency graph as a human-readable tree.
58    #[default]
59    Text,
60    /// Display the dependency graph as JSON.
61    Json,
62}
63
64#[derive(Debug, Default, Clone)]
65#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
66pub enum ListFormat {
67    /// Display the list of packages in a human-readable table.
68    #[default]
69    Columns,
70    /// Display the list of packages in a `pip freeze`-like format, with one package per line
71    /// alongside its version.
72    Freeze,
73    /// Display the list of packages in a machine-readable JSON format.
74    Json,
75}