File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ export class Clerc<C extends CommandRecord = {}> {
234
234
const { _ : args , flags } = parsed ;
235
235
let parameters = this . #isSingleCommand || ! isCommandResolved ? args : args . slice ( command . name . split ( " " ) . length ) ;
236
236
let commandParameters = command ?. parameters || [ ] ;
237
+ // eof handle
237
238
const hasEof = commandParameters . indexOf ( "--" ) ;
238
239
const eofParameters = commandParameters . slice ( hasEof + 1 ) || [ ] ;
239
240
const mapping : Record < string , string | string [ ] > = Object . create ( null ) ;
@@ -281,8 +282,8 @@ export class Clerc<C extends CommandRecord = {}> {
281
282
this . #commandEmitter. emit ( command . name , handlerContext ) ;
282
283
} ;
283
284
const inspectors = [ ...this . #inspectors, emitHandler ] ;
284
- const inspector = compose ( inspectors ) ;
285
- inspector ( getContext ) ;
285
+ const callInspector = compose ( inspectors ) ;
286
+ callInspector ( getContext ) ;
286
287
return this ;
287
288
}
288
289
}
Original file line number Diff line number Diff line change
1
+ import { Clerc , defineCommandWithHandler } from "./packages/clerc/src" ;
2
+ import { helpPlugin } from "./packages/plugin-help/src" ;
3
+
4
+ const _cli = Clerc . create ( )
5
+ . name ( "tsxt" )
6
+ . use ( helpPlugin ( ) )
7
+ . command ( "tmp as" , "f" , {
8
+ alias : [
9
+ "af" ,
10
+ ] ,
11
+ flags : {
12
+ ab : {
13
+ description : "adf" ,
14
+ type : Number ,
15
+ default : 123 ,
16
+ } ,
17
+ } ,
18
+ parameters : [
19
+ "<asfd>" ,
20
+ ] ,
21
+ } )
22
+ . on ( "tmp as" , ( ctx ) => {
23
+ ctx . name ;
24
+ ctx . flags ;
25
+ // console.log(ctx);
26
+ } )
27
+ // .command(CommandWithHandler)
28
+ . parse ( ) ;
You can’t perform that action at this time.
0 commit comments