Skip to content

Commit

Permalink
feat(cli): Add supported Tact version
Browse files Browse the repository at this point in the history
  • Loading branch information
byakuren-hijiri committed Jul 29, 2024
1 parent 10f1048 commit ae70f5d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { Command } from "commander";
import * as packageJson from "../package.json";

import { run } from "./driver";
import { MISTI_VERSION, TACT_VERSION } from "./version";
import { Command } from "commander";

const command = new Command();

command
.name("misti")
.description("TON Static Analyzer")
.version(packageJson.version)
.version(`${MISTI_VERSION}\n\nSupported Tact version: ${TACT_VERSION}`)
.arguments("<TACT_CONFIG_PATH|TACT_FILE_PATH>")
.option("--dump-cfg <type>", "Dump CFG in format: 'json' or 'dot'", undefined)
.option(
Expand Down
15 changes: 15 additions & 0 deletions src/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as packageJson from "../package.json";

export const MISTI_VERSION = packageJson.version;

/** The supported version of Tact. */
export const TACT_VERSION = removeCaret(
packageJson.dependencies["@tact-lang/compiler"],
);

function removeCaret(version: string): string {
if (version.startsWith("^")) {
return version.substring(1);
}
return version;
}

0 comments on commit ae70f5d

Please sign in to comment.