function display()

in commands/list.js [26:36]


function display(config) {
  const maxNameLength = config.profiles.map((d) => d.name.length).reduceRight((pre, current) => {
    return Math.max(pre, current);
  }, 0);

  console.log(` # | ${'Profile'.padEnd(maxNameLength, ' ')} | Credential `);
  console.log(`---|${'-'.repeat(maxNameLength + 2)}|----------`);
  for (const d of config.profiles) {
    console.log(` ${d.name === config.current ? '*' : ' '} | ${d.name.padEnd(maxNameLength, ' ')} | ${getDetail(d)}`);
  }
}