Parse and validate args and flags for cli tools
options
args
argumentsflags
flagsindent
how many spaces to indent help text
Parse and validate args and flags for cli tools
Returns object
Get help information for all args and flags as an object
Returns object
Get help text for all args
options
object?options.argsHeaderText
string? header text above list of arguments. default isArguments
options.flagsHeaderText
string? header text above list of flags. default isFlags
options.leftColumnWidth
number? width of left section in columns. default is the length of the longest arg or flag nameoptions.rightColumnWidth
number? width of right section in columns. default is the full width of the terminal minus the leftColumnWidthoptions.gutter
number? width of gutter in columns. default is4
Returns string
Format description
text
string description textleftColumnWidth
number width of left section in columnsrightColumnWidth
number width of right section in columnsgutter
number width of gutter in columns
Returns string
Get help text for all args
options
objectoptions.lines
array lines of text in an arrayoptions.longestLine
integer integer for the longest line in the array of lines (of both args and flags)options.headerText
string? header text above list of arguments. default isArguments:
options.leftColumnWidth
number? width of left section in columns. default is the length of the longest arg or flag nameoptions.rightColumnWidth
number? width of right section in columns. default is the full width of the terminal minus the leftColumnWidthoptions.gutter
number? width of gutter in columns. default is4
Returns string
Get help text for all flags
options
objectoptions.lines
array lines of text in an arrayoptions.longestLine
integer integer for the longest line in the array of lines (of both args and flags)options.headerText
string? header text above list of flags. default isFlags:
options.leftColumnWidth
number? width of left section in columns. default is the length of the longest arg or flag nameoptions.rightColumnWidth
number? width of right section in columns. default is the full width of the terminal minus the leftColumnWidthoptions.gutter
number? width of gutter in columns. default is4
Returns string