@@ -1825,17 +1825,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
1825
1825
}
1826
1826
1827
1827
/**
1828
- * Set the program version to `str` .
1828
+ * Get or set the program version.
1829
1829
*
1830
- * This method auto-registers the "-V, --version" flag
1831
- * which will print the version number when passed.
1830
+ * This method auto-registers the "-V, --version" option which will print the version number.
1832
1831
*
1833
- * You can optionally supply the flags and description to override the defaults.
1832
+ * You can optionally supply the flags and description to override the defaults.
1834
1833
*
1835
- * @param {string } str
1834
+ * @param {string } [ str]
1836
1835
* @param {string } [flags]
1837
1836
* @param {string } [description]
1838
- * @return {this | string } `this` command for chaining, or version string if no arguments
1837
+ * @return {this | string | undefined } `this` command for chaining, or version string if no arguments
1839
1838
*/
1840
1839
1841
1840
version ( str , flags , description ) {
@@ -1844,7 +1843,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1844
1843
flags = flags || '-V, --version' ;
1845
1844
description = description || 'output the version number' ;
1846
1845
const versionOption = this . createOption ( flags , description ) ;
1847
- this . _versionOptionName = versionOption . attributeName ( ) ;
1846
+ this . _versionOptionName = versionOption . attributeName ( ) ; // [sic] not defined in constructor, partly legacy, partly only needed at root
1848
1847
this . options . push ( versionOption ) ;
1849
1848
this . on ( 'option:' + versionOption . name ( ) , ( ) => {
1850
1849
this . _outputConfiguration . writeOut ( `${ str } \n` ) ;
0 commit comments