@qodly/cli
Version:
Qodly CLI
22 lines (19 loc) • 656 B
JavaScript
import chalk from "chalk";
const help = {
name: 'help',
description: 'Show this help',
execute ({ commands }) {
const list = [
...commands,
this
].sort((a, b)=>a.name.length - b.name.length);
const maxLength = list[list.length - 1].name.length + 2;
console.log(`qodly <command>
Available commands:
${list.map((cmd)=>`qodly ${chalk.green(cmd.name.padEnd(maxLength, ' '))} ${cmd.description}.${cmd.alias.length ? ` Alias${cmd.alias.length > 1 ? 'es' : ''}: ${cmd.alias.join(', ')}` : ''}`).join('\n')}
`);
},
alias: []
};
export default help;
//# sourceMappingURL=help.js.map