grace_cli/arguments/
into.rs

1use crate::core::case::string::Case;
2use clap::ValueEnum;
3
4/// Enum to represent the different cases that can be converted to.
5#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)]
6pub enum Into {
7    Altering,
8    Snake,
9    Camel,
10    Kebab,
11    Dot,
12    Header,
13    Normal,
14    Original,
15    Pascal,
16    Path,
17    Sentence,
18    Title,
19    UpperSnake,
20    WindowsPath,
21}
22
23/// Map the `Into` enum to the `Case` enum.
24pub fn map_case(value: &Into) -> Case {
25    match value {
26        Into::Altering => Case::Alternating,
27        Into::Snake => Case::Snake,
28        Into::Camel => Case::Camel,
29        Into::Kebab => Case::Kebab,
30        Into::Dot => Case::Dot,
31        Into::Header => Case::Header,
32        Into::Normal => Case::Normal,
33        Into::Original => Case::Original,
34        Into::Pascal => Case::Pascal,
35        Into::Path => Case::Path,
36        Into::Sentence => Case::Sentence,
37        Into::Title => Case::Title,
38        Into::UpperSnake => Case::UpperSnake,
39        Into::WindowsPath => Case::WindowsPath,
40    }
41}