-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMadrCli.java
More file actions
39 lines (31 loc) · 1.15 KB
/
MadrCli.java
File metadata and controls
39 lines (31 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 21+
//DEPS info.picocli:picocli:4.7.5
//DEPS org.eclipse.collections:eclipse-collections:11.1.0
//DEPS org.tinylog:tinylog-api:2.7.0
//DEPS org.tinylog:tinylog-impl:2.7.0
//FILES tinylog.properties
import picocli.CommandLine;
import java.nio.file.Files;
import java.nio.file.Path;
@CommandLine.Command(name = "madr-cli",
version = "madr-cli 0.1.0-SNAPSHOT",
mixinStandardHelpOptions = true,
sortSynopsis = false)
public class MadrCli {
@CommandLine.Command(name="upgrade", description = "Upgrades all MADR decisions to the latest MADR format")
int upgrade(
@CommandLine.Option(names = {"-d", "--directory"}, description = "Directory containing the ADRs", paramLabel = "<directory>")
String adrDirectory) {
Path adrDir = Path.of(adrDirectory);
if (!Files.exists(adrDir)) {
System.out.println("Directory " + adrDir + " does not exist");
return 10;
}
return 0;
}
public static void main(String... args) {
int exitCode = new CommandLine(new MadrCli()).execute(args);
System.exit(exitCode);
}
}