$darkmode
DENOPTIM
CLIOptions.java
Go to the documentation of this file.
1/*
2 * DENOPTIM
3 * Copyright (C) 2022 Marco Foscato <marco.foscato@uib.no>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package denoptim.main;
20
21import org.apache.commons.cli.Option;
22import org.apache.commons.cli.Options;
23
24import denoptim.constants.DENOPTIMConstants;
25import denoptim.main.Main.RunType;
26
27public class CLIOptions extends Options
28{
32 private static final long serialVersionUID = 3L;
33
37 public static Option help;
38
42 public static Option version;
43
47 public static Option run;
48
52 private static final CLIOptions instance = new CLIOptions();
53
54//------------------------------------------------------------------------------
55
56 private CLIOptions()
57 {
58 help = new Option("h","help",false, "Print help message.");
59 help.setRequired(false);
60 this.addOption(help);
61
62 run = new Option("r","run",true, "Request a specific type of "
63 + "run. Choose among:" + DENOPTIMConstants.EOL
65 + "When using -r, an input parameter file (e.g., input.params) "
66 + "must be specified as an additional argument.");
67 run.setRequired(false);
68 this.addOption(run);
69
70 version = new Option("v","version",false, "Print denoptim version.");
71 version.setRequired(false);
72 this.addOption(version);
73 }
74
75//------------------------------------------------------------------------------
76
81 public static CLIOptions getInstance()
82 {
83 return instance;
84 }
85
86//------------------------------------------------------------------------------
87
88}
General set of constants used in DENOPTIM.
static final String EOL
new line character
static final long serialVersionUID
Version ID.
Definition: CLIOptions.java:32
static final CLIOptions instance
The only, static instance of this class.
Definition: CLIOptions.java:52
static Option help
Option requesting the printing of the help message.
Definition: CLIOptions.java:37
static CLIOptions getInstance()
Gets the singleton instance of this class.
Definition: CLIOptions.java:81
static Option version
Option requesting only the printing of the version.
Definition: CLIOptions.java:42
static Option run
Option controlling the type of run.
Definition: CLIOptions.java:47
Types of runs that can be requested to the DENOPTIM Main class.
Definition: Main.java:63
static String getRunTypesForUser()
Returns a string that contains a textual list (e.g., "A, B, and C") of the possible types that can be...
Definition: Main.java:235