mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-24 07:46:39 +00:00
24 lines
421 B
CoffeeScript
24 lines
421 B
CoffeeScript
|
_ = require('lodash')
|
||
|
utils = require('./utils')
|
||
|
|
||
|
exports.option = (option) ->
|
||
|
result = utils.parseSignature(option)
|
||
|
|
||
|
exports.command = (command) ->
|
||
|
result = """
|
||
|
# #{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
|