Skip to content

Commit f279102

Browse files
Add descriptions to commands in the CLI tool
1 parent 2267de9 commit f279102

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ import { program } from "commander";
2727
import { readFileSync, writeFileSync } from "fs";
2828

2929
program
30-
.description("Compile .js to .astx")
30+
3131
.command("compile <input> <output>")
32+
.description("Compile .js to .astx")
3233
.action((input, output) => {
3334
console.log("Compiling...");
3435

@@ -51,8 +52,9 @@ program
5152
});
5253

5354
program
54-
.description("Run .astx files")
55+
5556
.command("run <input>")
57+
.description("Run .astx files")
5658
.action((input) => {
5759
console.log("Running...");
5860

@@ -63,10 +65,11 @@ program
6365
});
6466

6567
program
68+
69+
.command("gen <input> <output>")
6670
.description(
6771
"Generate .js code from .astx files (For debugging - code is not optimized or human readable)"
6872
)
69-
.command("gen <input> <output>")
7073
.action((input, output) => {
7174
console.log("Loading .astx file...");
7275

@@ -80,10 +83,11 @@ program
8083
});
8184

8285
program
86+
87+
.command("version")
8388
.description(
8489
"Show the version of the runtime and the astx/lib that includes the compiler"
8590
)
86-
.command("version")
8791
.action(() => {
8892
console.log(`Runtime: ${process.env.npm_package_version || "Unknown"}`);
8993
console.log(`Compiler: ${require("@astx/lib/package.json").version}`);

0 commit comments

Comments
 (0)