Skip to content

Decouple arguments description from command description #1192

@sergejostir

Description

@sergejostir

commander.js/index.js

Lines 1398 to 1416 in 516a14c

if (this._description) {
desc = [
this._description,
''
];
const argsDescription = this._argsDescription;
if (argsDescription && this._args.length) {
const width = this.padWidth();
const columns = process.stdout.columns || 80;
const descriptionWidth = columns - width - 5;
desc.push('Arguments:');
desc.push('');
this._args.forEach((arg) => {
desc.push(' ' + pad(arg.name, width) + ' ' + wrap(argsDescription[arg.name], descriptionWidth, width + 4));
});
desc.push('');
}
}

Hello.

Is there a special reason why we cannot only describe command arguments without the command itself?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions