Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helpInformation to typings #992

Closed
wants to merge 1 commit into from
Closed

Conversation

jharrilim
Copy link

Missing type for Commander.prototype.helpInformation:

commander.js/index.js

Lines 1085 to 1129 in 1c1ffca

Command.prototype.helpInformation = function() {
var desc = [];
if (this._description) {
desc = [
this._description,
''
];
var argsDescription = this._argsDescription;
if (argsDescription && this._args.length) {
var width = this.padWidth();
desc.push('Arguments:');
desc.push('');
this._args.forEach(function(arg) {
desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]);
});
desc.push('');
}
}
var cmdName = this._name;
if (this._alias) {
cmdName = cmdName + '|' + this._alias;
}
var usage = [
'Usage: ' + cmdName + ' ' + this.usage(),
''
];
var cmds = [];
var commandHelp = this.commandHelp();
if (commandHelp) cmds = [commandHelp];
var options = [
'Options:',
'' + this.optionHelp().replace(/^/gm, ' '),
''
];
return usage
.concat(desc)
.concat(options)
.concat(cmds)
.join('\n');
};

@shadowspawn
Copy link
Collaborator

This is as intended since helpInformation is marked in the JSDoc with @api private. We do not document the private api calls in the TypeScript.

@jharrilim
Copy link
Author

Ok makes sense. I was thinking maybe it should be declared as public so that I may get the string and not always write to stdout (perhaps another stream), but maybe I am designing my program wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants