code: def _get_program_cmd(name, pconfig, config, default):
      
      if pconfig is None:
          return name
      elif isinstance(pconfig, six.string_types):
          return pconfig
      elif "cmd" in pconfig:
          return pconfig["cmd"]
      elif default is not None:
          return default
      else:
          return name
docs: Retrieve commandline of a program.