From 55d9fc87db2df54b7f5d6c9a50613012c7ae50d7 Mon Sep 17 00:00:00 2001 From: Kevin Gilpin Date: Mon, 19 Jul 2021 16:14:07 -0400 Subject: [PATCH] feat: Add stub for agent 'init' command --- src/main/java/com/appland/appmap/cli/CLI.java | 5 ++++- src/main/java/com/appland/appmap/cli/Init.java | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/appland/appmap/cli/Init.java diff --git a/src/main/java/com/appland/appmap/cli/CLI.java b/src/main/java/com/appland/appmap/cli/CLI.java index bcc107b9..e1ce3e6f 100644 --- a/src/main/java/com/appland/appmap/cli/CLI.java +++ b/src/main/java/com/appland/appmap/cli/CLI.java @@ -8,7 +8,10 @@ public class CLI { public String directory; public static void main(String[] args) { - int exitCode = new CommandLine(new CLI()).addSubcommand("status", Status.class).execute(args); + int exitCode = new CommandLine(new CLI()) + .addSubcommand("status", Status.class) + .addSubcommand("init", Init.class) + .execute(args); System.exit(exitCode); } } diff --git a/src/main/java/com/appland/appmap/cli/Init.java b/src/main/java/com/appland/appmap/cli/Init.java new file mode 100644 index 00000000..ce161573 --- /dev/null +++ b/src/main/java/com/appland/appmap/cli/Init.java @@ -0,0 +1,15 @@ +package com.appland.appmap.cli; + +import picocli.CommandLine; +import java.util.concurrent.Callable; + +@CommandLine.Command(name = "init", description = "Suggests AppMap configuration settings for a new project.") +public class Init implements Callable { + @CommandLine.ParentCommand + private CLI parent; + + public Integer call() throws Exception { + System.err.printf("Init AppMap project configuration in directory: %s", parent.directory); + return 0; + } +}