mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-14 17:00:55 +00:00
25 lines
454 B
CoffeeScript
25 lines
454 B
CoffeeScript
_ = require('lodash')
|
|
ent = require('ent')
|
|
utils = require('./utils')
|
|
|
|
exports.option = (option) ->
|
|
result = utils.parseSignature(option)
|
|
|
|
exports.command = (command) ->
|
|
result = """
|
|
# #{ent.encode(command.signature)}
|
|
|
|
#{command.help}\n
|
|
"""
|
|
|
|
if not _.isEmpty(command.options)
|
|
result += '\n## Options'
|
|
|
|
for option in command.options
|
|
result += """
|
|
\n\n### #{utils.parseSignature(option)}
|
|
|
|
#{option.description}
|
|
"""
|
|
return result
|