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 TypeMethodDescriptionvoidAddsOptCfg(s) for a help option block to this help instance.voidAddsOptCfg(s) for a help option block to this help instance.voidaddOptsWithIndent(OptCfg[] cfgs, int indent) AddsOptCfg(s) and an indent width for a help option block to this help instance.voidaddOptsWithIndent(List<OptCfg> cfgs, int indent) AddsOptCfg(s) and an indent width for a help option block to this help instance.voidaddOptsWithIndentAndMargins(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.voidaddOptsWithIndentAndMargins(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.voidaddOptsWithMargins(OptCfg[] cfgs, int marginLeft, int marginRight) AddsOptCfg(s) and an indent width and margins for a help option block to this help instance.voidaddOptsWithMargins(List<OptCfg> cfgs, int marginLeft, int marginRight) AddsOptCfg(s) and an indent width and margins for a help option block to this help instance.voidAdds a text for a help text block to this help instance.voidAdds texts for a help text block to this help instance.voidAdds texts for a help text block to this help instance.voidaddTextsWithIndent(String[] texts, int indent) Adds texts and an indent width for a help text block to this help instance.voidaddTextsWithIndent(List<String> texts, int indent) Adds texts and an indent width for a help text block to this help instance.voidaddTextsWithIndentAndMargins(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.voidaddTextsWithIndentAndMargins(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.voidaddTextsWithMargins(String[] texts, int marginLeft, int marginRight) Adds texts and an indent width and margins for a help text block to this help instance.voidaddTextsWithMargins(List<String> texts, int marginLeft, int marginRight) Adds texts and an indent width and margins for a help text block to this help instance.voidaddTextWithIndent(String text, int indent) Adds a text and an indent width for a help text block to this help instance.voidaddTextWithIndentAndMargins(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.voidaddTextWithMargins(String text, int marginLeft, int marginRight) Adds a text and margins for a help text block to this help instance.iter()Creates aHelpIterinstance which is an iterator that outputs a help text line by line.voidprint()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 ofOptCfgmarginLeft- 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 ofOptCfgindent- 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 aHelpIterinstance 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.
-