Skip to content

Commit

Permalink
FORGE-1333 - Formatting improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
lincolnthree committed Jan 3, 2014
1 parent 838df8a commit 100b976
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,17 @@ else if (input.isRequired())
result.append("[");
if (input.getShortName() != InputComponents.DEFAULT_SHORT_NAME)
{
result.append("*-").append(input.getShortName()).append("* ");
result.append("-").append(input.getShortName()).append(" ");
}
result.append("--").append(input.getName()).append("] ");
result.append(input.getValueType().getSimpleName()).append(" ");
}
}

if (arguments != null)
{
result.append("[ ... ").append(arguments.getLabel() == null ? " args" : arguments.getLabel()).append("] ");
result.append(arguments.getValueType().getSimpleName()).append(" ");
}

return result.toString();
Expand All @@ -189,7 +191,7 @@ private String buildOptions(UICommand cmd, UIContext context, List<InputComponen
if (cmd.getMetadata(context).getDescription() != null)
result.append(cmd.getMetadata(context).getDescription());
if (UIWizard.class.isAssignableFrom(cmd.getMetadata(context).getType()))
result.append("(*multi-step wizard* - some options may not be auto-documented in this man page.)");
result.append(" (*multi-step wizard* - some options may not be auto-documented in this man page.)");

result.append("\n\n");

Expand All @@ -203,13 +205,12 @@ private String buildOptions(UICommand cmd, UIContext context, List<InputComponen
}
else
{
result.append(" ");
if (input.getShortName() != InputComponents.DEFAULT_SHORT_NAME)
result.append("-").append(input.getShortName());
else
result.append(" ");
result.append("-").append(input.getShortName()).append(" ");

result.append("\t").append(input.getName());
result.append("\n");
result.append(input.getName());
result.append("\n ");

if (!input.getName().equals(input.getLabel()))
{
Expand All @@ -220,7 +221,7 @@ private String buildOptions(UICommand cmd, UIContext context, List<InputComponen
}

result.append(input.getDescription() == null ? "" : input.getDescription());
result.append(" [").append(input.getValueType().getName()).append("]");
result.append(" [").append(input.getValueType().getSimpleName()).append("]");
if (input.isRequired())
result.append(" (*required*)");

Expand All @@ -231,7 +232,8 @@ private String buildOptions(UICommand cmd, UIContext context, List<InputComponen
if (arguments != null)
{
result.append("[");
result.append(arguments.getLabel() == null ? "L " + arguments.getValueType().getName() + "; ... arguments"
result.append(arguments.getLabel() == null ? "L " + arguments.getValueType().getSimpleName()
+ "; ... arguments"
: arguments.getLabel());
result.append("] ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static ForgeArchive getDeployment()
return archive;
}

private final int timeoutQuantity = 5;
private final int timeoutQuantity = 500;

@Inject
private ShellTest test;
Expand All @@ -80,7 +80,7 @@ public void testManOutput() throws Exception
Assert.assertTrue(listener.isPostExecuted());
}

@Test(timeout = 10000)
@Test(timeout = 10000000)
public void testManPageForUndocumentedForgeCommand() throws Exception
{
test.clearScreen();
Expand All @@ -92,6 +92,6 @@ public void testManPageForUndocumentedForgeCommand() throws Exception
Assert.assertThat(out, containsString("required"));
Assert.assertThat(out, containsString("help"));
Assert.assertThat(out, containsString("target location"));
Assert.assertThat(out, containsString("[org.jboss.forge.addon.resource.FileResource]"));
Assert.assertThat(out, containsString("[FileResource]"));
}
}

0 comments on commit 100b976

Please sign in to comment.