Helper
Outputs examples for usage (--help) information.
Example:
new Helper().outputHelp(
[{ command: "-v", description: "Outputs verbose error messages" }],
"link"
);
// => Examples:
// $ shinka link -v Outputs verbose error messages
Test:
Constructor Summary
Public Constructor | ||
public |
constructor(logger: LogObject) |
Method Summary
Public Methods | ||
public |
getLongest(a: Example, b: Example): Example Reducer helper for finding the example with the longest command. |
|
public |
Builds usage examples. |
|
public |
outputHelp(examples: Example[], command: string) Outputs usage examples. |
Public Constructors
Public Members
Public Methods
public getLongest(a: Example, b: Example): Example source
Reducer helper for finding the example with the longest command.
Test:
public help(examples: Example[], cmd: string): string[] source
Builds usage examples.
Example:
new Helper().help(
[{ command: "-v", description: "Outputs verbose error messages" }],
"link"
);
// => ["\n Examples: \n", "$ shinka link -v Outputs verbose error messages"]