@@ -0,0 +1,2127 @@
+/* Copyright (C) 2011-2020  Egon Willighagen %3Cegonw@users.sf.net%3E, Ammar Ammar %3Cammar257ammar@gmail.com%3E%0A *%0A * This program is free software; you can redistribute it and/or modify it under%0A * the terms of the GNU Lesser General Public License as published by the Free%0A * Software Foundation; either version 2.1 of the License, or (at your option)%0A * any later version.%0A *%0A * This program is distributed in the hope that it will be useful, but WITHOUT%0A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS%0A * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more%0A * details.%0A *%0A * You should have received a copy of the GNU Lesser General Public License%0A * along with this program; if not, write to the Free Software Foundation, Inc.,%0A * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.%0A */%0A%0Apackage org.bitbucket.nanojava;%0A%0Aimport picocli.CommandLine;%0Aimport picocli.CommandLine.Command;%0Aimport picocli.CommandLine.Option;%0A%0A@Command(name = %22nj%22)%0Apublic class CliOptions %7B%0A%0A%09@Option(names = %7B%22-h%22, %22-?%22, %22--help%22 %7D, usageHelp = true, description = %22Display a help message%22)%0A%09boolean help = false;%0A%0A%09@Option(names = %7B%22-d%22, %22--descriptor%22%7D, description = %22Select an operation to perform: desc (calculate descriptor value)%22, required = false)%0A%09String descriptor = %22%22;%0A%0A%09@Option(names = %7B%22-f%22, %22--file%22%7D, description = %22Select a file to read the materials from)%22, required = false)%0A%09String file = null;%0A%09%0A%09@Option(names = %7B%22-o%22, %22--output%22%7D, description = %22Select an output file path to write the descriptor value(s)%22, required = false)%0A%09String output = null;%0A%09%0A%09@Option(names = %7B%22-m%22, %22--material%22%7D, description = %22Provide the material formulae (e.g. Fe3O4)%22, required = false)%0A%09String material = %22%22;%0A%09%0A%09CliOptions(String%5B%5D args) %7B%0A%09%09try %7B%0A%09%09%09CliOptions cliOptions = CommandLine.populateCommand(this, args);%0A%09%09%09%0A%09%09%09if (cliOptions.help) %7B%0A%09%09%09%09new CommandLine(this).usage(System.out);%0A%09%09%09%09System.exit(0);%0A%09%09%09%7D%0A%09%09%09%0A%09%09%7D catch (CommandLine.ParameterException pe) %7B%0A%09%09%09System.out.println(pe.getMessage());%0A%09%09%09new CommandLine(this).usage(System.out);%0A%09%09%09System.exit(64);%0A%09%09%7D%0A%09%7D%0A%7D%0A

add main command line interface file