Skip to content

Commit f3f2445

Browse files
committed
add an arg to haxelib version
1 parent 436bd84 commit f3f2445

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/haxelib/client/Main.hx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,13 @@ class Main {
136136
}
137137

138138
function version() {
139-
Cli.print(VERSION_LONG);
139+
// Print haxelib version when no arguments are given
140+
if (mainArgs.length == 0) {
141+
Cli.print(VERSION_LONG);
142+
return;
143+
}
144+
145+
Cli.print(getRepository().getCurrentVersion(ProjectName.ofString(mainArgs[0])));
140146
}
141147

142148
static function combineAliases(name:String, aliases:Array<String>):String {
@@ -211,7 +217,7 @@ class Main {
211217
Config => create(config, 0),
212218
Path => create(path, null),
213219
LibPath => create(libpath, null),
214-
Version => create(version, 0),
220+
Version => create(version, 1),
215221
Help => create(usage, 0),
216222

217223
#if !js

0 commit comments

Comments
 (0)