balena-cli/extras/capitano-doc/markdown.coffee
2015-03-03 11:32:24 -04:00

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