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