connection_string_parser/
cli.rs1use clap::{Parser, ValueEnum};
2
3#[derive(ValueEnum, Clone, Debug)]
4pub enum Part {
5 Scheme,
6 Host,
7 Port,
8 User,
9 Password,
10 Path,
12}
13
14#[derive(Parser, Debug)]
15#[command(
16 about,
17 author,
18 version,
19 propagate_version = true,
20 next_line_help = false,
21 disable_help_subcommand = true,
22 after_long_help = "This tool can be used to extract parts of a connection string. It is useful for extracting the database name from a connection string, for example."
23)]
24pub struct Cli {
25 pub url: String,
27
28 #[arg(short, long, required = true)]
30 pub part: Part,
31
32 #[arg(short, long, default_value = "false")]
34 pub fail_silently: bool,
35}