Skip to content

Commit

Permalink
format: update to use tab spaces = 2 (#157)
Browse files Browse the repository at this point in the history
spaces 2
  • Loading branch information
JasonShin authored Jul 20, 2024
1 parent da03038 commit 6abe29b
Show file tree
Hide file tree
Showing 53 changed files with 3,547 additions and 3,529 deletions.
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ chain_width = 70
match_arm_leading_pipes = "Never"
# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#merge_derives
merge_derives = true
tab_spaces = 2
102 changes: 51 additions & 51 deletions src/common/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,78 @@ use clap::Parser;
use std::fmt;

impl fmt::Display for JsExtension {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let extension = match self {
JsExtension::Ts => ".ts".to_string(),
JsExtension::Js => ".js".to_string(),
};
write!(f, "{}", extension)
}
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let extension = match self {
JsExtension::Ts => ".ts".to_string(),
JsExtension::Js => ".js".to_string(),
};
write!(f, "{}", extension)
}
}

#[derive(Parser, Debug, Clone)]
#[clap(author, version, about)]
pub struct Cli {
/// Path to the Typescript or Javascript project
#[clap(parse(from_os_str))]
pub path: std::path::PathBuf,
/// Path to the Typescript or Javascript project
#[clap(parse(from_os_str))]
pub path: std::path::PathBuf,

/// Javascript Extension
#[clap(
/// Javascript Extension
#[clap(
value_enum,
long,
default_value_t=JsExtension::Ts
)]
pub ext: JsExtension,
pub ext: JsExtension,

/// Type of primary database to connect
#[clap(value_enum, long)]
pub db_type: Option<DatabaseType>,
/// Type of primary database to connect
#[clap(value_enum, long)]
pub db_type: Option<DatabaseType>,

/// Primary DB host
#[clap(long)]
pub db_host: Option<String>,
/// Primary DB host
#[clap(long)]
pub db_host: Option<String>,

/// Primary DB Port
#[clap(long)]
pub db_port: Option<u16>,
/// Primary DB Port
#[clap(long)]
pub db_port: Option<u16>,

/// Primary DB user
#[clap(long)]
pub db_user: Option<String>,
/// Primary DB user
#[clap(long)]
pub db_user: Option<String>,

/// Primary DB pass
#[clap(long)]
pub db_pass: Option<String>,
/// Primary DB pass
#[clap(long)]
pub db_pass: Option<String>,

/// Primary DB database name
#[clap(long)]
pub db_name: Option<String>,
/// Primary DB database name
#[clap(long)]
pub db_name: Option<String>,

/// PostgreSQL schema search path (default is "$user,public") https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH
#[clap(long)]
pub pg_search_path: Option<String>,
/// PostgreSQL schema search path (default is "$user,public") https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH
#[clap(long)]
pub pg_search_path: Option<String>,

/// Folder paths to ignore
#[clap(long, multiple_values = true)]
pub ignore: Vec<String>,
/// Folder paths to ignore
#[clap(long, multiple_values = true)]
pub ignore: Vec<String>,

/// Path to the file based configuration
#[clap(long, parse(from_os_str))]
pub config: Option<std::path::PathBuf>,
/// Path to the file based configuration
#[clap(long, parse(from_os_str))]
pub config: Option<std::path::PathBuf>,

/// generate types of raw SQLs using default configuration
#[clap(long, short)]
pub generate_types: bool,
/// generate types of raw SQLs using default configuration
#[clap(long, short)]
pub generate_types: bool,

/// generates types in a target directory path or a file
#[clap(long, parse(from_os_str))]
pub generate_path: Option<std::path::PathBuf>,
/// generates types in a target directory path or a file
#[clap(long, parse(from_os_str))]
pub generate_path: Option<std::path::PathBuf>,

#[clap(long, short)]
pub message_format: Option<String>,
#[clap(long, short)]
pub message_format: Option<String>,

/// log level to be used for the CLI info > warn > error
#[clap(value_enum, long)]
pub log_level: Option<LogLevel>,
/// log level to be used for the CLI info > warn > error
#[clap(value_enum, long)]
pub log_level: Option<LogLevel>,
}
Loading

0 comments on commit 6abe29b

Please sign in to comment.