docs: def command_generic_msg(hostname, result, oneline, caption):
      ''' output the result of a command run '''
  
      rc     = result.get('rc', '0')
      stdout = result.get('stdout','')
      stderr = result.get('stderr', '')
      msg    = result.get('msg', '')
  
      hostname = hostname.encode('utf-8')
      caption  = caption.encode('utf-8')
  
      if not oneline:
          buf = "%s | %s | rc=%s >>\n" % (hostname, caption, result.get('rc',0))
          if stdout:
              buf += stdout
          if stderr:
              buf += stderr
          if msg:
              buf += msg
          return buf + "\n"
      else:
          if stderr:
              return "%s | %s | rc=%s | (stdout) %s (stderr) %s" % (hostname, caption, rc, stdout, stderr)
          else:
              return "%s | %s | rc=%s | (stdout) %s" % (hostname, caption, rc, stdout)