@@ -6,13 +6,37 @@ import { main } from "./main";
6
6
const nameFormatDefault : NameFormat = "camel" ;
7
7
8
8
const { _ : patterns , includePaths, aliases, nameFormat } = yargs
9
- . demandOption ( "_" )
10
- . option ( "aliases" , { coerce : ( obj ) : Aliases => obj , alias : "a" } )
9
+ . usage (
10
+ "Generate .scss.d.ts from CSS module .scss files.\nUsage: $0 <glob pattern> [options]"
11
+ )
12
+ . example (
13
+ "$0 src/**/*.scss" ,
14
+ "All .scss files at any level in the src directoy"
15
+ )
16
+ . example (
17
+ "$0 src/**/*.scss --includePaths src/core src/variables" ,
18
+ 'Search the "core" and "variables" directory when resolving imports'
19
+ )
20
+ . example (
21
+ "$0 src/**/*.scss --aliases.~name variables" ,
22
+ 'Replace all imports for "~name" with "variables"'
23
+ )
24
+ . demandCommand ( 1 )
25
+ . option ( "aliases" , {
26
+ coerce : ( obj ) : Aliases => obj ,
27
+ alias : "a" ,
28
+ describe : "Alias any import to any other value."
29
+ } )
11
30
. option ( "nameFormat" , {
12
31
choices : NAME_FORMATS ,
13
32
default : nameFormatDefault ,
14
- alias : "n"
33
+ alias : "n" ,
34
+ describe : "The name format that should be used to transform class names."
15
35
} )
16
- . option ( "includePaths" , { array : true , string : true } ) . argv ;
36
+ . option ( "includePaths" , {
37
+ array : true ,
38
+ string : true ,
39
+ describe : "Additional paths to include when trying to resolve imports."
40
+ } ) . argv ;
17
41
18
42
main ( patterns [ 0 ] , { includePaths, aliases, nameFormat } ) ;
0 commit comments