@@ -16,6 +16,7 @@ const cli = yargs
16
16
. scriptName ( 'slidev' )
17
17
. usage ( '$0 [args]' )
18
18
. version ( version )
19
+ . strict ( )
19
20
. showHelpOnFail ( false )
20
21
. alias ( 'h' , 'help' )
21
22
. alias ( 'v' , 'version' )
@@ -41,6 +42,7 @@ cli.command(
41
42
choices : [ 'error' , 'warn' , 'info' , 'silent' ] ,
42
43
describe : 'log level' ,
43
44
} )
45
+ . strict ( )
44
46
. help ( ) ,
45
47
async ( { entry, theme, port, open, log } ) => {
46
48
if ( ! fs . existsSync ( entry ) && ! entry . endsWith ( '.md' ) )
@@ -120,6 +122,7 @@ cli.command(
120
122
type : 'boolean' ,
121
123
describe : 'allow download as PDF' ,
122
124
} )
125
+ . strict ( )
123
126
. help ( ) ,
124
127
async ( { entry, theme, watch, base, download, out } ) => {
125
128
const { build } = await import ( './build' )
@@ -143,6 +146,7 @@ cli.command(
143
146
'format [entry]' ,
144
147
'Format the markdown file' ,
145
148
args => commonOptions ( args )
149
+ . strict ( )
146
150
. help ( ) ,
147
151
async ( { entry } ) => {
148
152
const data = await parser . load ( entry )
@@ -174,6 +178,7 @@ cli.command(
174
178
type : 'string' ,
175
179
describe : 'page ranges to export, for example "1,4-5,6"' ,
176
180
} )
181
+ . strict ( )
177
182
. help ( ) ,
178
183
async ( {
179
184
entry,
@@ -214,7 +219,9 @@ cli.command(
214
219
} ,
215
220
)
216
221
217
- cli . help ( ) . parse ( )
222
+ cli
223
+ . help ( )
224
+ . parse ( )
218
225
219
226
function commonOptions ( args : Argv < { } > ) {
220
227
return args
0 commit comments