Skip to content

Commit 41683da

Browse files
committed
Add help command
This is mainly created for testing the conda installation
1 parent 3cf9ba4 commit 41683da

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

install

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ install_command st-add-annotations "cmd.AddAnnotations"
6363
install_command st-align-pairs "cmd.PairwiseSectionAligner"
6464
install_command st-align-pairs-view "cmd.ViewPairwiseAlignment"
6565
install_command st-align-global "cmd.GlobalOpt"
66+
install_command st-help "cmd.PrintHelp"
6667

6768
if [ $(pwd) == "$INSTALL_DIR" ]; then
6869
echo "Installation directory equals current directory, we are done."
@@ -79,6 +80,7 @@ else
7980
mv st-align-pairs $INSTALL_DIR/
8081
mv st-align-pairs-view $INSTALL_DIR/
8182
mv st-align-global $INSTALL_DIR/
83+
mv st-help $INSTALL_DIR/
8284
fi
8385

8486
rm cp.txt

src/main/java/cmd/PrintHelp.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

Comments
 (0)