Skip to content

Instantly share code, notes, and snippets.

@musketyr
Created October 12, 2021 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save musketyr/ed9d31c09dba396cd488721dee022b80 to your computer and use it in GitHub Desktop.
Save musketyr/ed9d31c09dba396cd488721dee022b80 to your computer and use it in GitHub Desktop.
package com.agorapulse;
import io.micronaut.configuration.picocli.PicocliRunner;
import io.micronaut.context.env.Environment;
import jakarta.inject.Inject;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;
import java.time.Instant;
@Command(name = "micronaut-aws-batch-demo", description = "AWS Batch Demo", mixinStandardHelpOptions = true)
public class MicronautAwsBatchDemoCommand implements Runnable {
@Option(names = {"-t", "--timestamp"}, description = "the time when the event was triggered")
Instant timestamp;
@Inject Environment environment;
public static void main(String[] args) throws Exception {
PicocliRunner.run(MicronautAwsBatchDemoCommand.class, args);
}
public void run() {
System.out.printf("Event sent at %s to the environments %s", timestamp, environment.getActiveNames());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment