Skip to content

Commit

Permalink
VersionPlugin should use ForgeEnvironment to get the current version …
Browse files Browse the repository at this point in the history
…info
  • Loading branch information
gastaldi committed Apr 8, 2013
1 parent f3cff7f commit 5e8dbdb
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
package org.jboss.forge.shell.plugins.builtin;

import javax.inject.Inject;

import org.jboss.forge.ForgeEnvironment;
import org.jboss.forge.shell.plugins.Alias;
import org.jboss.forge.shell.plugins.DefaultCommand;
import org.jboss.forge.shell.plugins.Help;
Expand All @@ -21,10 +24,14 @@
@Help("Displays the current Forge version.")
public class VersionPlugin implements Plugin
{

@Inject
private ForgeEnvironment environment;

@DefaultCommand
public void show(final PipeOut out)
{
String version = getClass().getPackage().getImplementationVersion();
String version = environment.getRuntimeVersion();
out.println("JBoss Forge, version [ " + version + " ] - JBoss, by Red Hat, Inc. [ http://jboss.org/forge ]");
}
}

0 comments on commit 5e8dbdb

Please sign in to comment.