001/*
002 * Copyright (c) 2012-2018 Institut National des Sciences Appliquées de Lyon (INSA Lyon) and others
003 *
004 * This program and the accompanying materials are made available under the
005 * terms of the Eclipse Public License 2.0 which is available at
006 * http://www.eclipse.org/legal/epl-2.0.
007 *
008 * SPDX-License-Identifier: EPL-2.0
009 */
010
011package org.eclipse.golo.cli.command;
012
013import com.beust.jcommander.Parameter;
014import com.beust.jcommander.Parameters;
015import org.eclipse.golo.cli.command.spi.CliCommand;
016
017@Parameters(commandNames = {"version"}, resourceBundle = "commands", commandDescriptionKey = "version")
018public class VersionCommand implements CliCommand {
019
020  @Parameter(names = "--full", description = "version.full")
021  boolean full = false;
022
023  @Override
024  public void execute() throws Throwable {
025    if (this.full) {
026      System.out.println("Golo: " + Metadata.VERSION + " (build " + Metadata.TIMESTAMP + ")");
027      System.out.println("JVM: " + System.getProperty("java.version"));
028    } else {
029      System.out.println(Metadata.VERSION);
030    }
031  }
032}