File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import { watchCommand } from './watch';
55
66cli ( {
77 name : 'tsx' ,
8- version,
98 parameters : [ '[script path]' ] ,
109 commands : [
1110 watchCommand ,
@@ -15,12 +14,37 @@ cli({
1514 type : Boolean ,
1615 description : 'Disable caching' ,
1716 } ,
17+ version : {
18+ type : Boolean ,
19+ description : 'Show version' ,
20+ } ,
21+ help : {
22+ type : Boolean ,
23+ alias : 'h' ,
24+ description : 'Show help' ,
25+ } ,
1826 } ,
19- help : {
20- description : 'Node.js runtime enhanced with esbuild for loading TypeScript & ESM' ,
21- } ,
27+ help : false ,
2228} , ( argv ) => {
23- run ( argv . _ , {
29+ if ( argv . _ . length === 0 ) {
30+ if ( argv . flags . version ) {
31+ console . log ( version ) ;
32+ return ;
33+ }
34+
35+ if ( argv . flags . help ) {
36+ argv . showHelp ( {
37+ description : 'Node.js runtime enhanced with esbuild for loading TypeScript & ESM' ,
38+ } ) ;
39+ return ;
40+ }
41+ }
42+
43+ const args = process . argv . slice ( 2 ) . filter (
44+ argument => ( argument !== '--no-cache' && argument !== '--noCache' ) ,
45+ ) ;
46+
47+ run ( args , {
2448 noCache : Boolean ( argv . flags . noCache ) ,
2549 } ) . on (
2650 'close' ,
You can’t perform that action at this time.
0 commit comments