mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 08:57:12 +02:00
Print documentation for flags
After writing a flag on the shell, pressing "tab" will print out the documentation for that flag. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=191899137
This commit is contained in:
parent
6699915132
commit
6d5f7dc4a1
2 changed files with 174 additions and 48 deletions
|
@ -134,9 +134,29 @@ public class ShellCommandTest {
|
|||
performJCommanderCompletorTest("help testCommand ", 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompletion_documentation() throws Exception {
|
||||
performJCommanderCompletorTest(
|
||||
"testCommand ",
|
||||
0,
|
||||
"",
|
||||
"Main parameter: normal argument\n (java.util.List<java.lang.String>)\n");
|
||||
performJCommanderCompletorTest("testAnotherCommand ", 0, "", "Main parameter: [None]\n");
|
||||
performJCommanderCompletorTest(
|
||||
"testCommand -x ", 0, "", "Flag documentation: test parameter\n (java.lang.String)\n");
|
||||
performJCommanderCompletorTest(
|
||||
"testAnotherCommand -x ", 0, "", "Flag documentation: [No documentation available]\n");
|
||||
performJCommanderCompletorTest(
|
||||
"testCommand x ",
|
||||
0,
|
||||
"",
|
||||
"Main parameter: normal argument\n (java.util.List<java.lang.String>)\n");
|
||||
performJCommanderCompletorTest("testAnotherCommand x ", 0, "", "Main parameter: [None]\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompletion_arguments() throws Exception {
|
||||
performJCommanderCompletorTest("testCommand ", 0, "-x ", "--xparam ", "--xorg ");
|
||||
performJCommanderCompletorTest("testCommand -", 1, "-x ", "--xparam ", "--xorg ");
|
||||
performJCommanderCompletorTest("testCommand --wrong", 7);
|
||||
performJCommanderCompletorTest("testCommand noise --", 2, "--xparam ", "--xorg ");
|
||||
performJCommanderCompletorTest("testAnotherCommand --o", 3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue