File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ use css_module_lexer:: { collect_dependencies, Mode } ;
2
+
3
+ fn main ( ) {
4
+ let Some ( path) = std:: env:: args ( ) . nth ( 1 ) else {
5
+ eprintln ! ( "USAGE: cli <path>" ) ;
6
+ return ;
7
+ } ;
8
+ let Ok ( input) = std:: fs:: read_to_string ( & path) else {
9
+ eprintln ! ( "Failed to read file: {}" , path) ;
10
+ return ;
11
+ } ;
12
+ let ( dependencies, warnings) = collect_dependencies ( & input, Mode :: Css ) ;
13
+ if dependencies. is_empty ( ) {
14
+ println ! ( "No dependencies found" ) ;
15
+ } else {
16
+ println ! ( "Dependencies:" ) ;
17
+ for dependency in dependencies {
18
+ println ! ( "{:?}" , dependency) ;
19
+ }
20
+ }
21
+ if warnings. is_empty ( ) {
22
+ println ! ( "No warnings found" ) ;
23
+ } else {
24
+ println ! ( "Warnings:" ) ;
25
+ for warning in warnings {
26
+ println ! ( "{:?}" , warning) ;
27
+ }
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments