slopcannon 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +8 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1953,10 +1953,12 @@ What it does:
|
|
|
1953
1953
|
`.trim();
|
|
1954
1954
|
function parseArgs() {
|
|
1955
1955
|
const args = process.argv.slice(2);
|
|
1956
|
-
const result = { help: false, config: false, cleanup: false };
|
|
1956
|
+
const result = { help: false, version: false, config: false, cleanup: false };
|
|
1957
1957
|
for (let i = 0;i < args.length; i++) {
|
|
1958
1958
|
if (args[i] === "--help" || args[i] === "-h") {
|
|
1959
1959
|
result.help = true;
|
|
1960
|
+
} else if (args[i] === "--version" || args[i] === "-v" || args[i] === "-V") {
|
|
1961
|
+
result.version = true;
|
|
1960
1962
|
} else if (args[i] === "--path-file" && i + 1 < args.length) {
|
|
1961
1963
|
result.pathFile = args[++i];
|
|
1962
1964
|
} else if (args[i] === "config") {
|
|
@@ -1983,6 +1985,11 @@ function requireGit(deps) {
|
|
|
1983
1985
|
}
|
|
1984
1986
|
async function main() {
|
|
1985
1987
|
const args = parseArgs();
|
|
1988
|
+
if (args.version) {
|
|
1989
|
+
const pkg = await Bun.file(new URL("../package.json", import.meta.url)).json();
|
|
1990
|
+
console.log(pkg.version);
|
|
1991
|
+
process.exit(0);
|
|
1992
|
+
}
|
|
1986
1993
|
if (args.help) {
|
|
1987
1994
|
console.log(HELP);
|
|
1988
1995
|
process.exit(0);
|