Skip to main content

cargo_uv/cli/
action.rs

1use std::ffi::OsString;
2
3use clap::builder::OsStr;
4use rusty_viking::EnumDisplay;
5
6#[derive(Debug, PartialEq, Eq, Clone, Copy, clap::ValueEnum, Default, EnumDisplay, Hash)]
7#[Lower]
8pub enum Action {
9    #[value(help = "Bump the version 1 prerelease level.", hide(true))]
10    // TODO: Remove when implemented.
11    Pre,
12    #[value(help = "Bump the version 1 patch level.")]
13    Patch,
14    #[value(help = "Bump the version 1 minor level.")]
15    Minor,
16    #[value(help = "Bump the version 1 major level.")]
17    Major,
18    #[value(help = "Set the version using valid semantic versioning.")]
19    Set,
20    #[value(help = "Print the current version of the package.")]
21    #[default]
22    Print,
23    /// Display the layout of the members in the workspace.
24    Tree,
25}
26
27impl From<Action> for OsStr {
28    fn from(action: Action) -> Self {
29        let string_rep = OsString::from(action.to_string());
30        Self::from(string_rep)
31    }
32}