@@ -3,78 +3,78 @@ use clap::Parser;
3
3
use std:: fmt;
4
4
5
5
impl fmt:: Display for JsExtension {
6
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
7
- let extension = match self {
8
- JsExtension :: Ts => ".ts" . to_string ( ) ,
9
- JsExtension :: Js => ".js" . to_string ( ) ,
10
- } ;
11
- write ! ( f, "{}" , extension)
12
- }
6
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
7
+ let extension = match self {
8
+ JsExtension :: Ts => ".ts" . to_string ( ) ,
9
+ JsExtension :: Js => ".js" . to_string ( ) ,
10
+ } ;
11
+ write ! ( f, "{}" , extension)
12
+ }
13
13
}
14
14
15
15
#[ derive( Parser , Debug , Clone ) ]
16
16
#[ clap( author, version, about) ]
17
17
pub struct Cli {
18
- /// Path to the Typescript or Javascript project
19
- #[ clap( parse( from_os_str) ) ]
20
- pub path : std:: path:: PathBuf ,
18
+ /// Path to the Typescript or Javascript project
19
+ #[ clap( parse( from_os_str) ) ]
20
+ pub path : std:: path:: PathBuf ,
21
21
22
- /// Javascript Extension
23
- #[ clap(
22
+ /// Javascript Extension
23
+ #[ clap(
24
24
value_enum,
25
25
long,
26
26
default_value_t=JsExtension :: Ts
27
27
) ]
28
- pub ext : JsExtension ,
28
+ pub ext : JsExtension ,
29
29
30
- /// Type of primary database to connect
31
- #[ clap( value_enum, long) ]
32
- pub db_type : Option < DatabaseType > ,
30
+ /// Type of primary database to connect
31
+ #[ clap( value_enum, long) ]
32
+ pub db_type : Option < DatabaseType > ,
33
33
34
- /// Primary DB host
35
- #[ clap( long) ]
36
- pub db_host : Option < String > ,
34
+ /// Primary DB host
35
+ #[ clap( long) ]
36
+ pub db_host : Option < String > ,
37
37
38
- /// Primary DB Port
39
- #[ clap( long) ]
40
- pub db_port : Option < u16 > ,
38
+ /// Primary DB Port
39
+ #[ clap( long) ]
40
+ pub db_port : Option < u16 > ,
41
41
42
- /// Primary DB user
43
- #[ clap( long) ]
44
- pub db_user : Option < String > ,
42
+ /// Primary DB user
43
+ #[ clap( long) ]
44
+ pub db_user : Option < String > ,
45
45
46
- /// Primary DB pass
47
- #[ clap( long) ]
48
- pub db_pass : Option < String > ,
46
+ /// Primary DB pass
47
+ #[ clap( long) ]
48
+ pub db_pass : Option < String > ,
49
49
50
- /// Primary DB database name
51
- #[ clap( long) ]
52
- pub db_name : Option < String > ,
50
+ /// Primary DB database name
51
+ #[ clap( long) ]
52
+ pub db_name : Option < String > ,
53
53
54
- /// PostgreSQL schema search path (default is "$user,public") https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH
55
- #[ clap( long) ]
56
- pub pg_search_path : Option < String > ,
54
+ /// PostgreSQL schema search path (default is "$user,public") https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH
55
+ #[ clap( long) ]
56
+ pub pg_search_path : Option < String > ,
57
57
58
- /// Folder paths to ignore
59
- #[ clap( long, multiple_values = true ) ]
60
- pub ignore : Vec < String > ,
58
+ /// Folder paths to ignore
59
+ #[ clap( long, multiple_values = true ) ]
60
+ pub ignore : Vec < String > ,
61
61
62
- /// Path to the file based configuration
63
- #[ clap( long, parse( from_os_str) ) ]
64
- pub config : Option < std:: path:: PathBuf > ,
62
+ /// Path to the file based configuration
63
+ #[ clap( long, parse( from_os_str) ) ]
64
+ pub config : Option < std:: path:: PathBuf > ,
65
65
66
- /// generate types of raw SQLs using default configuration
67
- #[ clap( long, short) ]
68
- pub generate_types : bool ,
66
+ /// generate types of raw SQLs using default configuration
67
+ #[ clap( long, short) ]
68
+ pub generate_types : bool ,
69
69
70
- /// generates types in a target directory path or a file
71
- #[ clap( long, parse( from_os_str) ) ]
72
- pub generate_path : Option < std:: path:: PathBuf > ,
70
+ /// generates types in a target directory path or a file
71
+ #[ clap( long, parse( from_os_str) ) ]
72
+ pub generate_path : Option < std:: path:: PathBuf > ,
73
73
74
- #[ clap( long, short) ]
75
- pub message_format : Option < String > ,
74
+ #[ clap( long, short) ]
75
+ pub message_format : Option < String > ,
76
76
77
- /// log level to be used for the CLI info > warn > error
78
- #[ clap( value_enum, long) ]
79
- pub log_level : Option < LogLevel > ,
77
+ /// log level to be used for the CLI info > warn > error
78
+ #[ clap( value_enum, long) ]
79
+ pub log_level : Option < LogLevel > ,
80
80
}
0 commit comments