### Table of Contents - [ArgsAndFlags][1] - [Parameters][2] - [parse][3] - [Parameters][4] - [helpObject][5] - [Parameters][6] - [help][7] - [Parameters][8] - [formatDescription][9] - [Parameters][10] - [argsHelp][11] - [Parameters][12] - [flagsHelp][13] - [Parameters][14] ## ArgsAndFlags Parse and validate args and flags for cli tools ### Parameters - `options` - `args` arguments - `flags` flags - `indent` how many spaces to indent help text ### parse Parse and validate args and flags for cli tools #### Parameters - `argsInput` **[Array][15]<[object][16]>** actual args supplied at command line Returns **[object][16]** ### helpObject Get help information for all args and flags as an object #### Parameters - `options` **[object][16]?** - `options.indent` **[string][17]?** amount to indent lines Returns **[object][16]** ### help Get help text for all args #### Parameters - `options` **[object][16]?** - `options.argsHeaderText` **[string][17]?** header text above list of arguments. default is `Arguments` - `options.flagsHeaderText` **[string][17]?** header text above list of flags. default is `Flags` - `options.leftColumnWidth` **[number][18]?** width of left section in columns. default is the length of the longest arg or flag name - `options.rightColumnWidth` **[number][18]?** width of right section in columns. default is the full width of the terminal minus the leftColumnWidth - `options.gutter` **[number][18]?** width of gutter in columns. default is `4` Returns **[string][17]** ### formatDescription Format description #### Parameters - `text` **[string][17]** description text - `leftColumnWidth` **[number][18]** width of left section in columns - `rightColumnWidth` **[number][18]** width of right section in columns - `gutter` **[number][18]** width of gutter in columns Returns **[string][17]** ### argsHelp Get help text for all args #### Parameters - `options` **[object][16]** - `options.lines` **[array][15]** lines of text in an array - `options.longestLine` **integer** integer for the longest line in the array of lines (of both args and flags) - `options.headerText` **[string][17]?** header text above list of arguments. default is `Arguments:` - `options.leftColumnWidth` **[number][18]?** width of left section in columns. default is the length of the longest arg or flag name - `options.rightColumnWidth` **[number][18]?** width of right section in columns. default is the full width of the terminal minus the leftColumnWidth - `options.gutter` **[number][18]?** width of gutter in columns. default is `4` Returns **[string][17]** ### flagsHelp Get help text for all flags #### Parameters - `options` **[object][16]** - `options.lines` **[array][15]** lines of text in an array - `options.longestLine` **integer** integer for the longest line in the array of lines (of both args and flags) - `options.headerText` **[string][17]?** header text above list of flags. default is `Flags:` - `options.leftColumnWidth` **[number][18]?** width of left section in columns. default is the length of the longest arg or flag name - `options.rightColumnWidth` **[number][18]?** width of right section in columns. default is the full width of the terminal minus the leftColumnWidth - `options.gutter` **[number][18]?** width of gutter in columns. default is `4` Returns **[string][17]** [1]: #argsandflags [2]: #parameters [3]: #parse [4]: #parameters-1 [5]: #helpobject [6]: #parameters-2 [7]: #help [8]: #parameters-3 [9]: #formatdescription [10]: #parameters-4 [11]: #argshelp [12]: #parameters-5 [13]: #flagshelp [14]: #parameters-6 [15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array [16]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object [17]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String [18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number