|
| 1 | +package cmd; |
| 2 | + |
| 3 | +import picocli.CommandLine; |
| 4 | +import picocli.CommandLine.Option; |
| 5 | + |
| 6 | +import java.util.HashMap; |
| 7 | +import java.util.Map; |
| 8 | +import java.util.Map.Entry; |
| 9 | +import java.util.concurrent.Callable; |
| 10 | + |
| 11 | +public class PrintHelp implements Callable<Void> { |
| 12 | + |
| 13 | + @Option(names = {"-v", "--version"}, required = false, description = "print version information") |
| 14 | + private boolean version = false; |
| 15 | + |
| 16 | + @Override |
| 17 | + public Void call() throws Exception { |
| 18 | + |
| 19 | + if (version) { |
| 20 | + System.out.println("Spatial Transcriptomics as IMages project -- v0.2.0"); |
| 21 | + return null; |
| 22 | + } |
| 23 | + |
| 24 | + final Map<String, Callable<Void>> commands = new HashMap<>(); |
| 25 | + commands.put("st-explorer", new View()); |
| 26 | + commands.put("st-render", new RenderImage()); |
| 27 | + commands.put("st-bdv-view", new DisplayStackedSlides()); |
| 28 | + commands.put("st-resave", new Resave()); |
| 29 | + commands.put("st-add-slice", new AddDataset()); |
| 30 | + commands.put("st-normalize", new Normalize()); |
| 31 | + commands.put("st-add-annotations", new AddAnnotations()); |
| 32 | + commands.put("st-align-pairs", new PairwiseSectionAligner()); |
| 33 | + commands.put("st-align-pairs-view", new ViewPairwiseAlignment()); |
| 34 | + commands.put("st-align-global", new GlobalOpt()); |
| 35 | + |
| 36 | + for (final Entry<String, Callable<Void>> command : commands.entrySet()) { |
| 37 | + System.out.println(); |
| 38 | + System.out.println("Usage for " + command.getKey() + ":"); |
| 39 | + CommandLine.usage(command.getValue(), System.out); |
| 40 | + } |
| 41 | + |
| 42 | + return null; |
| 43 | + } |
| 44 | + |
| 45 | + public static void main(final String[] args) { |
| 46 | + CommandLine.call(new PrintHelp(), args); |
| 47 | + } |
| 48 | +} |
0 commit comments