Skip to content

Commit

Permalink
add an arg to haxelib version
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjamuffin99 committed Aug 27, 2024
1 parent 968d34c commit cf2ecbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Binary file modified run.n
Binary file not shown.
10 changes: 8 additions & 2 deletions src/haxelib/client/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,13 @@ class Main {
}

function version() {
Cli.print(VERSION_LONG + ' ${HAXELIB_EDITION}');
// Print haxelib version when no arguments are given
if (mainArgs.length == 0) {
Cli.print(VERSION_LONG + ' ${HAXELIB_EDITION}');
return;
}

Cli.print(getRepository().getCurrentVersion(ProjectName.ofString(mainArgs[0])));
}

static function combineAliases(name:String, aliases:Array<String>):String {
Expand Down Expand Up @@ -219,7 +225,7 @@ class Main {
Config => create(config, 0),
Path => create(path, null),
LibPath => create(libpath, null),
Version => create(version, 0),
Version => create(version, 1),
Help => create(usage, 0),

#if !js
Expand Down

0 comments on commit cf2ecbd

Please sign in to comment.