java.lang.Object
com.github.sttk.cliargs.Help
Is the class to print a help text with an
OptCfg
array.
This class can output with margins and indentation for each option and text block.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
AddsOptCfg
(s) for a help option block to this help instance.void
AddsOptCfg
(s) for a help option block to this help instance.void
addOptsWithIndent
(OptCfg[] cfgs, int indent) AddsOptCfg
(s) and an indent width for a help option block to this help instance.void
addOptsWithIndent
(List<OptCfg> cfgs, int indent) AddsOptCfg
(s) and an indent width for a help option block to this help instance.void
addOptsWithIndentAndMargins
(OptCfg[] cfgs, int indent, int marginLeft, int marginRight) AddsOptCfg
(s) and an indent width and margins for a help option block to this help instance.void
addOptsWithIndentAndMargins
(List<OptCfg> cfgs, int indent, int marginLeft, int marginRight) AddsOptCfg
(s) and an indent width and margins for a help option block to this help instance.void
addOptsWithMargins
(OptCfg[] cfgs, int marginLeft, int marginRight) AddsOptCfg
(s) and an indent width and margins for a help option block to this help instance.void
addOptsWithMargins
(List<OptCfg> cfgs, int marginLeft, int marginRight) AddsOptCfg
(s) and an indent width and margins for a help option block to this help instance.void
Adds a text for a help text block to this help instance.void
Adds texts for a help text block to this help instance.void
Adds texts for a help text block to this help instance.void
addTextsWithIndent
(String[] texts, int indent) Adds texts and an indent width for a help text block to this help instance.void
addTextsWithIndent
(List<String> texts, int indent) Adds texts and an indent width for a help text block to this help instance.void
addTextsWithIndentAndMargins
(String[] texts, int indent, int marginLeft, int marginRight) Adds texts and an indent width and margins for a help text block to this help instance.void
addTextsWithIndentAndMargins
(List<String> texts, int indent, int marginLeft, int marginRight) Adds texts and an indent width and margins for a help text block to this help instance.void
addTextsWithMargins
(String[] texts, int marginLeft, int marginRight) Adds texts and an indent width and margins for a help text block to this help instance.void
addTextsWithMargins
(List<String> texts, int marginLeft, int marginRight) Adds texts and an indent width and margins for a help text block to this help instance.void
addTextWithIndent
(String text, int indent) Adds a text and an indent width for a help text block to this help instance.void
addTextWithIndentAndMargins
(String text, int indent, int marginLeft, int marginRight) Adds a text and an indent width and margins for a help text block to this help instance.void
addTextWithMargins
(String text, int marginLeft, int marginRight) Adds a text and margins for a help text block to this help instance.iter()
Creates aHelpIter
instance which is an iterator that outputs a help text line by line.void
print()
Outputs a help text to the standard output.
-
Constructor Details
-
Help
public Help()Constructs an instance of this class with 0 margins. -
Help
public Help(int marginLeft, int marginRight) Constructs an instance of this class with left and right margins.- Parameters:
marginLeft
- A left margin.marginRight
- A right margin.
-
-
Method Details
-
addText
Adds a text for a help text block to this help instance. The indent width of this help text block is set to auto indentation. The margins of a help text generated by this instance equals them which specified at a constructor.- Parameters:
text
- A text for a help text block.
-
addTextWithIndent
Adds a text and an indent width for a help text block to this help instance. The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of a help text generated by this instance equals them which specified at a constructor.- Parameters:
text
- A text for a help text block.indent
- An indent size.
-
addTextWithMargins
Adds a text and margins for a help text block to this help instance. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor. The indent width of this help text block is set to *auto indentation*.- Parameters:
text
- A text for a help text block.marginLeft
- A left margin.marginRight
- A right margin.
-
addTextWithIndentAndMargins
Adds a text and an indent width and margins for a help text block to this help instance. The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor.- Parameters:
text
- A text for a help text block.indent
- An indent size.marginLeft
- A left margin.marginRight
- A right margin.
-
addTexts
Adds texts for a help text block to this help instance. The indent width of this help text block is set to *auto indentation*. The margins of a help text generated by this instance equals them which specified at a constructor.- Parameters:
texts
- Texts for a help text block.
-
addTexts
Adds texts for a help text block to this help instance. The indent width of this help text block is set to *auto indentation*. The margins of a help text generated by this instance equals them which specified at a constructor.- Parameters:
texts
- Texts for a help text block.
-
addTextsWithIndent
Adds texts and an indent width for a help text block to this help instance. The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of a help text generated by this instance equals them which specified at the `new` function.- Parameters:
texts
- Texts for a help text block.indent
- An indent size.
-
addTextsWithIndent
Adds texts and an indent width for a help text block to this help instance. The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of a help text generated by this instance equals them which specified at the `new` function.- Parameters:
texts
- Texts for a help text block.indent
- An indent size.
-
addTextsWithMargins
Adds texts and an indent width and margins for a help text block to this help instance. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor. The indent width of this help text block is set to *auto indentation*.- Parameters:
texts
- Texts for a help text block.marginLeft
- A left margin.marginRight
- A right margin.
-
addTextsWithMargins
Adds texts and an indent width and margins for a help text block to this help instance. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor. The indent width of this help text block is set to *auto indentation*.- Parameters:
texts
- Texts for a help text block.marginLeft
- A left margin.marginRight
- A right margin.
-
addTextsWithIndentAndMargins
public void addTextsWithIndentAndMargins(String[] texts, int indent, int marginLeft, int marginRight) Adds texts and an indent width and margins for a help text block to this help instance. The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor.- Parameters:
texts
- Texts for a help text block.indent
- An indent size.marginLeft
- A left margin.marginRight
- A right margin.
-
addTextsWithIndentAndMargins
public void addTextsWithIndentAndMargins(List<String> texts, int indent, int marginLeft, int marginRight) Adds texts and an indent width and margins for a help text block to this help instance. The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor.- Parameters:
texts
- Texts for a help text block.indent
- An indent size.marginLeft
- A left margin.marginRight
- A right margin.
-
addOpts
AddsOptCfg
(s) for a help option block to this help instance. The indent width of this help text block is set to *auto indentation*. The margins of a help text generated by this instance equals them which specified at a constructor.- Parameters:
cfgs
- An array ofOptCfg
-
addOpts
AddsOptCfg
(s) for a help option block to this help instance. The indent width of this help text block is set to *auto indentation*. The margins of a help text generated by this instance equals them which specified at a constructor.- Parameters:
cfgs
- A list ofOptCfg
.
-
addOptsWithIndent
AddsOptCfg
(s) and an indent width for a help option block to this help instance. The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of a help text generated by this instance equals them which specified at a constructor.- Parameters:
cfgs
- An array ofOptCfg
.indent
- An indent size.
-
addOptsWithIndent
AddsOptCfg
(s) and an indent width for a help option block to this help instance. The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of a help text generated by this instance equals them which specified at a constructor.- Parameters:
cfgs
- A list ofOptCfg
.indent
- An indent size.
-
addOptsWithMargins
AddsOptCfg
(s) and an indent width and margins for a help option block to this help instance. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor. The indent width of this help text block is set to *auto indentation*.- Parameters:
cfgs
- An array ofOptCfg
marginLeft
- A left margin.marginRight
- A right margin.
-
addOptsWithMargins
AddsOptCfg
(s) and an indent width and margins for a help option block to this help instance. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor. The indent width of this help text block is set to *auto indentation*.- Parameters:
cfgs
- A list ofOptCfg
.marginLeft
- A left margin.marginRight
- A right margin.
-
addOptsWithIndentAndMargins
AddsOptCfg
(s) and an indent width and margins for a help option block to this help instance. The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor.- Parameters:
cfgs
- An array ofOptCfg
indent
- An indent size.marginLeft
- A left margin.marginRight
- A right margin.
-
addOptsWithIndentAndMargins
public void addOptsWithIndentAndMargins(List<OptCfg> cfgs, int indent, int marginLeft, int marginRight) AddsOptCfg
(s) and an indent width and margins for a help option block to this help instance. The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor.- Parameters:
cfgs
- A list ofOptCfg
.indent
- An indent size.marginLeft
- A left margin.marginRight
- A right margin.
-
iter
Creates aHelpIter
instance which is an iterator that outputs a help text line by line.- Returns:
- An iterator of each line of a help text.
-
print
public void print()Outputs a help text to the standard output.
-