This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release: com.io7m.claypot 0.0.3 Change: Introduce commands() method to return map of commands (Ticket: #4) Change: (Backwards incompatible) Introduce ClaypotType interface Change: Allow applications to publish documentation URIs. (Ticket: #2)
- Loading branch information
Showing
11 changed files
with
159 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
com.io7m.claypot.core/src/main/java/com/io7m/claypot/core/ClaypotType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | ||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR | ||
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
|
||
package com.io7m.claypot.core; | ||
|
||
import com.beust.jcommander.JCommander; | ||
|
||
import java.util.SortedMap; | ||
|
||
/** | ||
* The main wrapper over {@link JCommander}. | ||
*/ | ||
|
||
public interface ClaypotType | ||
{ | ||
/** | ||
* @return The exit code resulting from the most recent {@link #execute(String[])} | ||
*/ | ||
|
||
int exitCode(); | ||
|
||
/** | ||
* Execute the wrapper for the given command-line arguments. | ||
* | ||
* @param args The command-line arguments | ||
*/ | ||
|
||
void execute(String[] args); | ||
|
||
/** | ||
* @return The available commands, by name | ||
*/ | ||
|
||
SortedMap<String, CLPCommandType> commands(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...io7m.claypot.core/src/main/java/com/io7m/claypot/core/internal/CLPLongUsageFormatter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright © 2020 Mark Raynsford <code@io7m.com> http://io7m.com | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | ||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR | ||
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
|
||
package com.io7m.claypot.core.internal; | ||
|
||
import com.beust.jcommander.DefaultUsageFormatter; | ||
import com.beust.jcommander.JCommander; | ||
|
||
public final class CLPLongUsageFormatter extends DefaultUsageFormatter | ||
{ | ||
public CLPLongUsageFormatter( | ||
final JCommander commander) | ||
{ | ||
super(commander); | ||
} | ||
|
||
@Override | ||
public void appendMainLine( | ||
final StringBuilder out, | ||
final boolean hasOptions, | ||
final boolean hasCommands, | ||
final int indentCount, | ||
final String indent) | ||
{ | ||
super.appendMainLine(out, hasOptions, hasCommands, indentCount, indent); | ||
out.append('\n'); | ||
} | ||
|
||
@Override | ||
public void appendCommands( | ||
final StringBuilder out, | ||
final int indentCount, | ||
final int descriptionIndent, | ||
final String indent) | ||
{ | ||
out.append('\n'); | ||
super.appendCommands(out, indentCount, descriptionIndent, indent); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters