UNPKG

tiny-bin

Version:

A library for building tiny and beautiful command line apps.

22 lines (21 loc) 518 B
/* IMPORT */ import colors from 'tiny-colors'; import Collection from './collection.js'; /* MAIN */ class Arguments extends Collection { /* API */ print(mode) { const args = this.getAll(); if (!args.length) return; const table = args.map(arg => [ colors.yellow(arg.name), arg.description ]); this.stdout.group('ARGUMENTS', () => { this.stdout.table(table, mode); }); } } /* EXPORT */ export default Arguments;