Initial commit, 90% there
This commit is contained in:
27
node_modules/command-line-usage/lib/section.js
generated
vendored
Normal file
27
node_modules/command-line-usage/lib/section.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict'
|
||||
const ansi = require('ansi-escape-sequences')
|
||||
const os = require('os')
|
||||
const arrayify = require('array-back')
|
||||
|
||||
class Section {
|
||||
constructor () {
|
||||
this.list = []
|
||||
}
|
||||
add (content) {
|
||||
arrayify(content).forEach(line => this.list.push(ansi.format(line)))
|
||||
}
|
||||
emptyLine () {
|
||||
this.list.push('')
|
||||
}
|
||||
header (text) {
|
||||
if (text) {
|
||||
this.add(ansi.format(text, [ 'underline', 'bold' ]))
|
||||
this.emptyLine()
|
||||
}
|
||||
}
|
||||
toString () {
|
||||
return this.list.join(os.EOL)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Section
|
||||
Reference in New Issue
Block a user