Skip to content

Commit 4311312

Browse files
committed
Feature: Support passing file
1 parent 91a175f commit 4311312

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/cli.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function parseCommandLine(): CommandLineArguments {
2020
return cli as any as CommandLineArguments;
2121
}
2222

23-
const compilerOptions = parseCommandLine();
23+
const cliOptions = parseCommandLine();
2424

2525
const options = {
2626
lib: [
@@ -30,9 +30,7 @@ const options = {
3030
types: []
3131
};
3232

33-
const files = [
34-
'sandbox/do-simple-math.ts'
35-
];
33+
const files = cliOptions.args;
3634

3735
const host = ts.createCompilerHost(options);
3836
const program = ts.createProgram(files, options, host);
@@ -61,6 +59,6 @@ const llvmModule = generateModuleFromProgram(program);
6159

6260
llvm.verifyModule(llvmModule);
6361

64-
if (compilerOptions.printIR) {
62+
if (cliOptions.printIR) {
6563
console.log(llvmModule.print());
6664
}

0 commit comments

Comments
 (0)